[PATCH 2/2] exit_notify: kill the wrong capable(CAP_KILL) check

Oleg Nesterov
2009-02-25T19:12:20Z

I can't understand why exit_notify() checks capable(CAP_KILL), but this
looks just wrong.

Whatever logic we have to reset ->exit_signal, the bad user can bypass
it if it execs the setuid application before exiting, kill the CAP_KILL
check.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>

--- 6.29-rc3/kernel/exit.c~2_EXIT_NOTIFY 2009-02-13 07:04:12.000000000 +0100
+++ 6.29-rc3/kernel/exit.c 2009-02-25 19:41:57.000000000 +0100
@@ -874,8 +874,7 @@ static void exit_notify(struct task_stru
*/
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);