]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
perf symbol-minimal: Fix ehdr reading in filename__read_build_id
authorIan Rogers <irogers@google.com>
Sat, 23 Aug 2025 00:00:23 +0000 (17:00 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Mon, 25 Aug 2025 22:07:18 +0000 (15:07 -0700)
commitba0b7081f7a521d7c28b527a4f18666a148471e7
tree6070b3859baadd6ec56575b52b549c432edab816
parentf79a62f4b3c750759e60a402e8fe5180fc5771f0
perf symbol-minimal: Fix ehdr reading in filename__read_build_id

The e_ident is part of the ehdr and so reading it a second time would
mean the read ehdr was displaced by 16-bytes. Switch from stdio to
open/read/lseek syscalls for similarity with the symbol-elf version of
the function and so that later changes can alter then open flags.

Fixes: fef8f648bb47 ("perf symbol: Fix use-after-free in filename__read_build_id")
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250823000024.724394-2-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/symbol-minimal.c