[PATCH v1 0/4] perf: Fix and optimize maps parsing, boundaries, and bounds safety
From: Ian Rogers
Date: Mon Jul 20 2026 - 14:05:33 EST
It turns out that PATH_MAX is respected by system calls but isn't
respected by file paths in /proc/pid/maps and /proc/pid/smaps. In the
kernel "//toolong" is placed in the filename of mmap/mmap2 events
where the filename is longer than PATH_MAX, do the same in the
mmap/mmap2 synthesis code to avoid overrunning the event buffer. With
Gemini's help try to address other correctness and overrun issues.
Ian Rogers (4):
perf find-map: Remove PATH_MAX 128-byte stack array restriction
perf synthetic-events: Fix line synchronization, bounds, and
truncation bugs in proc maps reader
perf synthetic-events: Fix bounds, stale state, and misc flags in
kernel module synthesis
perf synthetic-events: Fix bounds and union member access in mmap2
build_id synthesis
tools/perf/util/find-map.c | 11 +-
tools/perf/util/synthetic-events.c | 271 ++++++++++++++++++++---------
2 files changed, 196 insertions(+), 86 deletions(-)
--
2.55.0.229.g6434b31f56-goog