]> Gentwo Git Trees - linux/.git/commit
libperf mmap: In user mmap rdpmc avoid undefined behavior
authorIan Rogers <irogers@google.com>
Sun, 14 Sep 2025 18:24:37 +0000 (11:24 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 2 Oct 2025 18:02:47 +0000 (15:02 -0300)
commit8dc364fa484df22d301a16148d1b356931d0cbb0
treea4ead39f5a56ce187c9a7ae480a20fef6eb42079
parentde1111f91a7a681303265938c2ad32f5ec3f21b7
libperf mmap: In user mmap rdpmc avoid undefined behavior

A shift left of a signed 64-bit s64 may overflow and result in
undefined behavior caught by ubsan. Switch to a u64 instead.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/perf/mmap.c