aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-09-25 05:27:20 -0400
committerEric W. Biederman <ebiederm@xmission.com>2018-10-03 10:47:43 -0400
commitae7795bc6187a15ec51cf258abae656a625f9980 (patch)
tree2456aa85c6b4be1ac58e272393056c0edbee038a /include/linux/security.h
parent4cd2e0e70af6897ca2247fa1ffb1553ca16b4903 (diff)
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/security.h')
-rw-r--r--include/linux/security.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index 75f4156c84d7..d170a5b031f3 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -35,7 +35,7 @@
35struct linux_binprm; 35struct linux_binprm;
36struct cred; 36struct cred;
37struct rlimit; 37struct rlimit;
38struct siginfo; 38struct kernel_siginfo;
39struct sembuf; 39struct sembuf;
40struct kern_ipc_perm; 40struct kern_ipc_perm;
41struct audit_context; 41struct audit_context;
@@ -361,7 +361,7 @@ int security_task_setrlimit(struct task_struct *p, unsigned int resource,
361int security_task_setscheduler(struct task_struct *p); 361int security_task_setscheduler(struct task_struct *p);
362int security_task_getscheduler(struct task_struct *p); 362int security_task_getscheduler(struct task_struct *p);
363int security_task_movememory(struct task_struct *p); 363int security_task_movememory(struct task_struct *p);
364int security_task_kill(struct task_struct *p, struct siginfo *info, 364int security_task_kill(struct task_struct *p, struct kernel_siginfo *info,
365 int sig, const struct cred *cred); 365 int sig, const struct cred *cred);
366int security_task_prctl(int option, unsigned long arg2, unsigned long arg3, 366int security_task_prctl(int option, unsigned long arg2, unsigned long arg3,
367 unsigned long arg4, unsigned long arg5); 367 unsigned long arg4, unsigned long arg5);
@@ -1020,7 +1020,7 @@ static inline int security_task_movememory(struct task_struct *p)
1020} 1020}
1021 1021
1022static inline int security_task_kill(struct task_struct *p, 1022static inline int security_task_kill(struct task_struct *p,
1023 struct siginfo *info, int sig, 1023 struct kernel_siginfo *info, int sig,
1024 const struct cred *cred) 1024 const struct cred *cred)
1025{ 1025{
1026 return 0; 1026 return 0;