]> Gentwo Git Trees - linux/.git/commit
perf symbol-minimal: Be more defensive when reading build IDs
authorIan Rogers <irogers@google.com>
Sun, 14 Sep 2025 18:31:31 +0000 (11:31 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 2 Oct 2025 18:01:26 +0000 (15:01 -0300)
commitde1111f91a7a681303265938c2ad32f5ec3f21b7
tree997cb921510ec8d77f2fb3107a2ee723af559f1c
parent4fc844347ec1c755c460be2c7aa684cc3580fea3
perf symbol-minimal: Be more defensive when reading build IDs

The note_data at ptr is read as a nhdr but this may yield
out-of-bounds reads if there isn't nhdrs worth of data.

Be more defensive before doing the reads.

This is motivated by address sanitizer capturing out of bounds reads
running "perf top".

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol-minimal.c