aboutsummaryrefslogtreecommitdiffstats
path: root/security
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 /security
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 'security')
-rw-r--r--security/apparmor/lsm.c2
-rw-r--r--security/security.c2
-rw-r--r--security/selinux/hooks.c2
-rw-r--r--security/smack/smack_lsm.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 8b8b70620bbe..cbcb8ba51142 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -732,7 +732,7 @@ static int apparmor_task_setrlimit(struct task_struct *task,
732 return error; 732 return error;
733} 733}
734 734
735static int apparmor_task_kill(struct task_struct *target, struct siginfo *info, 735static int apparmor_task_kill(struct task_struct *target, struct kernel_siginfo *info,
736 int sig, const struct cred *cred) 736 int sig, const struct cred *cred)
737{ 737{
738 struct aa_label *cl, *tl; 738 struct aa_label *cl, *tl;
diff --git a/security/security.c b/security/security.c
index 736e78da1ab9..0d504fceda8b 100644
--- a/security/security.c
+++ b/security/security.c
@@ -1147,7 +1147,7 @@ int security_task_movememory(struct task_struct *p)
1147 return call_int_hook(task_movememory, 0, p); 1147 return call_int_hook(task_movememory, 0, p);
1148} 1148}
1149 1149
1150int security_task_kill(struct task_struct *p, struct siginfo *info, 1150int security_task_kill(struct task_struct *p, struct kernel_siginfo *info,
1151 int sig, const struct cred *cred) 1151 int sig, const struct cred *cred)
1152{ 1152{
1153 return call_int_hook(task_kill, 0, p, info, sig, cred); 1153 return call_int_hook(task_kill, 0, p, info, sig, cred);
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index ad9a9b8e9979..1b500b4c78a7 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4186,7 +4186,7 @@ static int selinux_task_movememory(struct task_struct *p)
4186 PROCESS__SETSCHED, NULL); 4186 PROCESS__SETSCHED, NULL);
4187} 4187}
4188 4188
4189static int selinux_task_kill(struct task_struct *p, struct siginfo *info, 4189static int selinux_task_kill(struct task_struct *p, struct kernel_siginfo *info,
4190 int sig, const struct cred *cred) 4190 int sig, const struct cred *cred)
4191{ 4191{
4192 u32 secid; 4192 u32 secid;
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 340fc30ad85d..025de76af1db 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -2251,7 +2251,7 @@ static int smack_task_movememory(struct task_struct *p)
2251 * Return 0 if write access is permitted 2251 * Return 0 if write access is permitted
2252 * 2252 *
2253 */ 2253 */
2254static int smack_task_kill(struct task_struct *p, struct siginfo *info, 2254static int smack_task_kill(struct task_struct *p, struct kernel_siginfo *info,
2255 int sig, const struct cred *cred) 2255 int sig, const struct cred *cred)
2256{ 2256{
2257 struct smk_audit_info ad; 2257 struct smk_audit_info ad;