diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2018-09-25 12:27:20 +0300 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2018-10-03 17:47:43 +0300 |
commit | ae7795bc6187a15ec51cf258abae656a625f9980 (patch) | |
tree | 2456aa85c6b4be1ac58e272393056c0edbee038a /include/linux/coredump.h | |
parent | 4cd2e0e70af6897ca2247fa1ffb1553ca16b4903 (diff) | |
download | linux-ae7795bc6187a15ec51cf258abae656a625f9980.tar.xz |
signal: Distinguish between kernel_siginfo and siginfo
Linus recently observed that if we did not worry about the padding
member in struct siginfo it is only about 48 bytes, and 48 bytes is
much nicer than 128 bytes for allocating on the stack and copying
around in the kernel.
The obvious thing of only adding the padding when userspace is
including siginfo.h won't work as there are sigframe definitions in
the kernel that embed struct siginfo.
So split siginfo in two; kernel_siginfo and siginfo. Keeping the
traditional name for the userspace definition. While the version that
is used internally to the kernel and ultimately will not be padded to
128 bytes is called kernel_siginfo.
The definition of struct kernel_siginfo I have put in include/signal_types.h
A set of buildtime checks has been added to verify the two structures have
the same field offsets.
To make it easy to verify the change kernel_siginfo retains the same
size as siginfo. The reduction in size comes in a following change.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/coredump.h')
-rw-r--r-- | include/linux/coredump.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/coredump.h b/include/linux/coredump.h index 207aed96a5b7..abf4b4e65dbb 100644 --- a/include/linux/coredump.h +++ b/include/linux/coredump.h @@ -17,9 +17,9 @@ extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr); extern int dump_align(struct coredump_params *cprm, int align); extern void dump_truncate(struct coredump_params *cprm); #ifdef CONFIG_COREDUMP -extern void do_coredump(const siginfo_t *siginfo); +extern void do_coredump(const kernel_siginfo_t *siginfo); #else -static inline void do_coredump(const siginfo_t *siginfo) {} +static inline void do_coredump(const kernel_siginfo_t *siginfo) {} #endif #endif /* _LINUX_COREDUMP_H */ |