diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2021-05-04 18:25:22 +0200 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2021-07-23 20:15:31 +0200 |
commit | 50ae81305c7a3ee802f0a1988503ce913c79cd6e (patch) | |
tree | 8564c815a010b129d6af244f1570ad55f763757f /include/uapi/asm-generic | |
parent | signal: Remove the generic __ARCH_SI_TRAPNO support (diff) | |
download | linux-50ae81305c7a3ee802f0a1988503ce913c79cd6e.tar.xz linux-50ae81305c7a3ee802f0a1988503ce913c79cd6e.zip |
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>
Diffstat (limited to 'include/uapi/asm-generic')
-rw-r--r-- | include/uapi/asm-generic/siginfo.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/uapi/asm-generic/siginfo.h b/include/uapi/asm-generic/siginfo.h index 5a3c221f4c9d..3ba180f550d7 100644 --- a/include/uapi/asm-generic/siginfo.h +++ b/include/uapi/asm-generic/siginfo.h @@ -29,6 +29,11 @@ typedef union sigval { #define __ARCH_SI_ATTRIBUTES #endif +/* + * Be careful when extending this union. On 32bit siginfo_t is 32bit + * aligned. Which means that a 64bit field or any other field that + * would increase the alignment of siginfo_t will break the ABI. + */ union __sifields { /* kill() */ struct { |