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

From: Oleg Nesterov
Date: Wed Feb 25 2009 - 14:12:20 EST


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@xxxxxxxxxx>

--- 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);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/