diff options
author | Andrii Nakryiko <[email protected]> | 2024-08-29 10:42:23 -0700 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2024-09-11 09:58:30 -0700 |
commit | 905415ff3ffb1d7e5afa62bacabd79776bd24606 (patch) | |
tree | 877ac974a6befe3bb808f66dfde056f6548fc216 /tools/perf/scripts/python/task-analyzer.py | |
parent | 58ff04e2e22319e63ea646d9a38890c17836a7f6 (diff) |
lib/buildid: harden build ID parsing logic
Harden build ID parsing logic, adding explicit READ_ONCE() where it's
important to have a consistent value read and validated just once.
Also, as pointed out by Andi Kleen, we need to make sure that entire ELF
note is within a page bounds, so move the overflow check up and add an
extra note_size boundaries validation.
Fixes tag below points to the code that moved this code into
lib/buildid.c, and then subsequently was used in perf subsystem, making
this code exposed to perf_event_open() users in v5.12+.
Cc: [email protected]
Reviewed-by: Eduard Zingerman <[email protected]>
Reviewed-by: Jann Horn <[email protected]>
Suggested-by: Andi Kleen <[email protected]>
Fixes: bd7525dacd7e ("bpf: Move stack_map_get_build_id into lib")
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions