]> git.baikalelectronics.ru Git - kernel.git/commit
perf: uapi: Document perf_event_attr::sig_data truncation on 32 bit architectures
authorMarco Elver <elver@google.com>
Mon, 31 Jan 2022 10:34:07 +0000 (11:34 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 2 Feb 2022 12:11:40 +0000 (13:11 +0100)
commit4226c37cd4072f65cbcfab97a75b78e5eb77059b
treee3e3e3e0d39ced09c898006b35437ad933c52fe8
parent3a22b2e676fdf89834be1f4bcee0593ab7ae7f6e
perf: uapi: Document perf_event_attr::sig_data truncation on 32 bit architectures

Due to the alignment requirements of siginfo_t, as described in
71b076e9452a ("signal, perf: Fix siginfo_t by avoiding u64 on 32-bit
architectures"), siginfo_t::si_perf_data is limited to an unsigned long.

However, perf_event_attr::sig_data is an u64, to avoid having to deal
with compat conversions. Due to being an u64, it may not immediately be
clear to users that sig_data is truncated on 32 bit architectures.

Add a comment to explicitly point this out, and hopefully help some
users save time by not having to deduce themselves what's happening.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Link: https://lore.kernel.org/r/20220131103407.1971678-3-elver@google.com
include/uapi/linux/perf_event.h