aboutsummaryrefslogtreecommitdiff
path: root/arch/sparc/kernel/signal_64.c
diff options
context:
space:
mode:
authorEric W. Biederman <[email protected]>2021-05-04 11:25:22 -0500
committerEric W. Biederman <[email protected]>2021-07-23 13:15:31 -0500
commit50ae81305c7a3ee802f0a1988503ce913c79cd6e (patch)
tree8564c815a010b129d6af244f1570ad55f763757f /arch/sparc/kernel/signal_64.c
parentc7fff9288dce1ee5fa9de8d656e09cc8e0e3281b (diff)
signal: Verify the alignment and size of siginfo_t
Update the static assertions about siginfo_t to also describe it's alignment and size. While investigating if it was possible to add a 64bit field into siginfo_t[1] it became apparent that the alignment of siginfo_t is as much a part of the ABI as the size of the structure. If the alignment changes siginfo_t when embedded in another structure can move to a different offset. Which is not acceptable from an ABI structure. So document that fact and add static assertions to notify developers if they change change the alignment by accident. [1] https://lkml.kernel.org/r/[email protected] Acked-by: Marco Elver <[email protected]> v1: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/875yxaxmyl.fsf_-_@disp2133 Signed-off-by: "Eric W. Biederman" <[email protected]>
Diffstat (limited to 'arch/sparc/kernel/signal_64.c')
-rw-r--r--arch/sparc/kernel/signal_64.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
index a58e0cc45d24..cea23cf95600 100644
--- a/arch/sparc/kernel/signal_64.c
+++ b/arch/sparc/kernel/signal_64.c
@@ -567,6 +567,8 @@ static_assert(NSIGBUS == 5);
static_assert(NSIGTRAP == 6);
static_assert(NSIGCHLD == 6);
static_assert(NSIGSYS == 2);
+static_assert(sizeof(siginfo_t) == 128);
+static_assert(__alignof__(siginfo_t) == 8);
static_assert(offsetof(siginfo_t, si_signo) == 0x00);
static_assert(offsetof(siginfo_t, si_errno) == 0x04);
static_assert(offsetof(siginfo_t, si_code) == 0x08);