Commit 6760d77b authored by Stefano Sanfilippo's avatar Stefano Sanfilippo Committed by Arnaldo Carvalho de Melo

perf jit: Check JITHEADER_VERSION

Check the version number when opening a jitdump file.  Accept older
versions, but not newer ones.
Signed-off-by: default avatarStefano Sanfilippo <ssanfilippo@chromium.org>
Signed-off-by: default avatarRoss McIlroy <rmcilroy@chromium.org>
Reviewed-by: default avatarStephane Eranian <eranian@google.com>
Cc: Anton Blanchard <anton@ozlabs.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1476356383-30100-9-git-send-email-eranian@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 086f9f3d
......@@ -180,6 +180,12 @@ jit_open(struct jit_buf_desc *jd, const char *name)
header.elf_mach,
jd->use_arch_timestamp);
if (header.version > JITHEADER_VERSION) {
pr_err("wrong jitdump version %u, expected " STR(JITHEADER_VERSION),
header.version);
goto error;
}
if (header.flags & JITDUMP_FLAGS_RESERVED) {
pr_err("jitdump file contains invalid or unsupported flags 0x%llx\n",
(unsigned long long)header.flags & JITDUMP_FLAGS_RESERVED);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment