summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2026-05-23 15:30:15 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2026-05-29 11:44:35 -0300
commitf6ded4d1e8b5e29278605e89c893197fb484c2a6 (patch)
treef96d074662d83d1d5cf6f18a783913f92c7af966 /tools/perf/scripts/python
parent48d004c0742dcbc940ffb3b7390540c5a200729e (diff)
perf session: Snapshot event->header.size in process_user_event()
On native-endian files, events are read from MAP_SHARED memory. Multiple reads of event->header.size can return different values if the file is concurrently modified, allowing an attacker to bypass bounds checks performed on an earlier read. Snapshot header.size into a local variable at function entry using READ_ONCE() to prevent compiler rematerialization, and use it for all size-dependent arithmetic within the function. This ensures every bounds calculation uses the same value that was validated by the reader. Reported-by: sashiko-bot@kernel.org # Running on a local machine Reviewed-by: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Assisted-by: Claude:claude-opus-4.6-1m Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions