From: Oleg Nesterov Date: Mon, 6 Apr 2009 14:16:02 +0000 (+0200) Subject: exit_notify: kill the wrong capable(CAP_KILL) check (CVE-2009-1337) X-Git-Tag: v2.6.28.10~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eab3d542839412d2e7fa712d0dfcc1b90f2755ed;p=thirdparty%2Fkernel%2Fstable.git exit_notify: kill the wrong capable(CAP_KILL) check (CVE-2009-1337) CVE-2009-1337 commit 432870dab85a2f69dc417022646cb9a70acf7f94 upstream. The CAP_KILL check in exit_notify() looks just wrong, kill it. Whatever logic we have to reset ->exit_signal, the malicious user can bypass it if it execs the setuid application before exiting. Signed-off-by: Oleg Nesterov Acked-by: Serge Hallyn Acked-by: Roland McGrath Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/exit.c b/kernel/exit.c index 10e393b5381bf..dd9bfe2547130 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -942,8 +942,7 @@ static void exit_notify(struct task_struct *tsk, int group_dead) */ if (tsk->exit_signal != SIGCHLD && !task_detached(tsk) && (tsk->parent_exec_id != tsk->real_parent->self_exec_id || - tsk->self_exec_id != tsk->parent_exec_id) && - !capable(CAP_KILL)) + tsk->self_exec_id != tsk->parent_exec_id)) tsk->exit_signal = SIGCHLD; signal = tracehook_notify_death(tsk, &cookie, group_dead);