summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin/stackcollapse-report
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2026-07-16 00:23:46 -0700
committerNamhyung Kim <namhyung@kernel.org>2026-07-17 22:34:06 -0700
commit1243a5e741a4f93312a2da16929bb66edb5d5b25 (patch)
tree20bc37d5583329163e26731d566790f585cf5a09 /tools/perf/scripts/python/bin/stackcollapse-report
parentc6275783931ddb9d82a2d52e932d4e85bff5f588 (diff)
perf disasm: Fix potential NULL pointer dereference and use-after-free in arch__find()
In arch__find(), if the architecture's arch_new_fn[e_machine]() returns NULL, the error handling path attempts to read result->name, dereferencing a NULL pointer and crashing. At the same time, it invokes free(tmp) BEFORE updating the static global archs pointer to tmp. If the reallocarray() call moved the allocated block, the original archs pointer remained active but was freed. A subsequent call to arch__find() would then pass this dangling pointer into bsearch(), causing a use-after-free. Fix both by printing the numeric e_machine ID instead of result->name, and updating the static global archs pointer to tmp immediately after the successful reallocarray() invocation to safely retain the valid prior architectures. Closes: https://lore.kernel.org/linux-perf-users/20260709035721.9EE901F000E9@smtp.kernel.org/ Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions