diff options
| author | Avi Weiss <thnkslprpt@gmail.com> | 2026-10-20 13:12:24 +0300 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-10-24 00:46:50 -0700 |
| commit | b1d68946a08313895f352af5336623d29739c299 (patch) | |
| tree | 54346665edb85503259b21e43ebef641dffdf2e2 /scripts/Makefile.thinlto | |
| parent | 66644b992f25f6a33775788c8b69a8bb3d41ad67 (diff) | |
| download | linux-next-b1d68946a08313895f352af5336623d29739c299.tar.gz linux-next-b1d68946a08313895f352af5336623d29739c299.zip | |
profiling: fix sampling step on 64-bit big-endian systems
read_profile() stores the sampling step in an unsigned long but copies
only four bytes to userspace. On 64-bit big-endian systems (not common
obviously), this copies the upper 32 bits and discards the rest, causing
/proc/profile to report zero for normal shift values.
Cast to unsigned int so we get the correct 4 bytes, while keeping the
shift calculation in unsigned long.
A small C reproducer under qemu-s390x reproduced this and proved the fix
works for prof_shift=2.
Link: https://lore.kernel.org/20261020101225.917959-1-thnkslprpt@gmail.com
Fixes: 2d186afd04d6 ("profiling: fix shift-out-of-bounds bugs")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
