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

Ian Rogers posted 8 patches 1 year ago
There is a newer version of this series
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(-)
[PATCH v1 0/8] Various fixes around undefined behavior
Posted by Ian Rogers 1 year ago
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
Re: [PATCH v1 0/8] Various fixes around undefined behavior
Posted by Namhyung Kim 1 year ago
On Fri, Dec 13, 2024 at 01:04:17PM -0800, Ian Rogers wrote:
> 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

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> 
>  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
>