aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorStephen Smalley <sds@tycho.nsa.gov>2017-01-10 12:28:32 -0500
committerPaul Moore <paul@paul-moore.com>2017-01-12 11:10:57 -0500
commit3a2f5a59a695a73e0cde9a61e0feae5fa730e936 (patch)
tree058704d18e909a2c0b46356c74d3c1156c2206aa /security/selinux/hooks.c
parentb4ba35c75a0671a06b978b6386b54148efddf39f (diff)
security,selinux,smack: kill security_task_wait hook
As reported by yangshukui, a permission denial from security_task_wait() can lead to a soft lockup in zap_pid_ns_processes() since it only expects sys_wait4() to return 0 or -ECHILD. Further, security_task_wait() can in general lead to zombies; in the absence of some way to automatically reparent a child process upon a denial, the hook is not useful. Remove the security hook and its implementations in SELinux and Smack. Smack already removed its check from its hook. Reported-by: yangshukui <yangshukui@huawei.com> Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Acked-by: Casey Schaufler <casey@schaufler-ca.com> Acked-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 55ad878f1146..a5398fea0966 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3963,12 +3963,6 @@ static int selinux_task_kill(struct task_struct *p, struct siginfo *info,
3963 return avc_has_perm(secid, task_sid(p), SECCLASS_PROCESS, perm, NULL); 3963 return avc_has_perm(secid, task_sid(p), SECCLASS_PROCESS, perm, NULL);
3964} 3964}
3965 3965
3966static int selinux_task_wait(struct task_struct *p)
3967{
3968 return avc_has_perm(task_sid(p), current_sid(), SECCLASS_PROCESS,
3969 PROCESS__SIGCHLD, NULL);
3970}
3971
3972static void selinux_task_to_inode(struct task_struct *p, 3966static void selinux_task_to_inode(struct task_struct *p,
3973 struct inode *inode) 3967 struct inode *inode)
3974{ 3968{
@@ -6211,7 +6205,6 @@ static struct security_hook_list selinux_hooks[] = {
6211 LSM_HOOK_INIT(task_getscheduler, selinux_task_getscheduler), 6205 LSM_HOOK_INIT(task_getscheduler, selinux_task_getscheduler),
6212 LSM_HOOK_INIT(task_movememory, selinux_task_movememory), 6206 LSM_HOOK_INIT(task_movememory, selinux_task_movememory),
6213 LSM_HOOK_INIT(task_kill, selinux_task_kill), 6207 LSM_HOOK_INIT(task_kill, selinux_task_kill),
6214 LSM_HOOK_INIT(task_wait, selinux_task_wait),
6215 LSM_HOOK_INIT(task_to_inode, selinux_task_to_inode), 6208 LSM_HOOK_INIT(task_to_inode, selinux_task_to_inode),
6216 6209
6217 LSM_HOOK_INIT(ipc_permission, selinux_ipc_permission), 6210 LSM_HOOK_INIT(ipc_permission, selinux_ipc_permission),