[PATCH v1 0/8] Various fixes around undefined behavior

From: Ian Rogers
Date: Fri Dec 13 2024 - 16:04:57 EST


Fix various undefined behavior issues, improve tests to make them
easier to diagnose and add assertions so that problems don't recur.

Ian Rogers (8):
perf disasm: Avoid undefined behavior in incrementing NULL
perf test trace_btf_enum: Skip if permissions are insufficient
tools headers: Update offsetof and container_of
perf evsel: Avoid container_of on a NULL leader
tools headers: Add non-NULL assert to container_of
perf maps: Avoid UB passing NULL to bsearch
perf test shell lock_contention: Extra debug diagnostics
libperf event: Ensure tracing data is multiple of 8 sized

tools/include/linux/kernel.h | 16 ++++++++++------
tools/lib/perf/include/perf/event.h | 1 +
tools/perf/tests/shell/lock_contention.sh | 9 +++++++--
tools/perf/tests/shell/trace_btf_enum.sh | 11 +++++++++++
tools/perf/util/disasm.c | 7 +++++--
tools/perf/util/evsel.c | 2 ++
tools/perf/util/maps.c | 9 ++++++---
7 files changed, 42 insertions(+), 13 deletions(-)

--
2.47.1.613.gc27f4b7a9f-goog