]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
signal: Verify the alignment and size of siginfo_t
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 4 May 2021 16:25:22 +0000 (11:25 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 23 Jul 2021 18:15:31 +0000 (13:15 -0500)
commit50ae81305c7a3ee802f0a1988503ce913c79cd6e
tree8564c815a010b129d6af244f1570ad55f763757f
parentc7fff9288dce1ee5fa9de8d656e09cc8e0e3281b
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/YJEZdhe6JGFNYlum@elver.google.com
Acked-by: Marco Elver <elver@google.com>
v1: https://lkml.kernel.org/r/20210505141101.11519-4-ebiederm@xmission.co
Link: https://lkml.kernel.org/r/875yxaxmyl.fsf_-_@disp2133
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
arch/arm/kernel/signal.c
arch/arm64/kernel/signal.c
arch/arm64/kernel/signal32.c
arch/sparc/kernel/signal32.c
arch/sparc/kernel/signal_64.c
arch/x86/kernel/signal_compat.c
include/uapi/asm-generic/siginfo.h