From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761767AbZEFWBb (ORCPT ); Wed, 6 May 2009 18:01:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761450AbZEFVyg (ORCPT ); Wed, 6 May 2009 17:54:36 -0400 Received: from kroah.org ([198.145.64.141]:57045 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761252AbZEFVyc (ORCPT ); Wed, 6 May 2009 17:54:32 -0400 X-Mailbox-Line: From gregkh@mini.kroah.org Wed May 6 14:47:57 2009 Message-Id: <20090506214757.609252331@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Wed, 06 May 2009 14:45:45 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Oleg Nesterov , Serge Hallyn , Roland McGrath Subject: [patch 17/58] exit_notify: kill the wrong capable(CAP_KILL) check (CVE-2009-1337) References: <20090506214528.660389067@mini.kroah.org> Content-Disposition: inline; filename=exit_notify-kill-the-wrong-capable-check.patch In-Reply-To: <20090506215017.GA21981@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2.6.29-stable review patch. If anyone has any objections, please let us know. ------------------ From: Oleg Nesterov 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 --- kernel/exit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/kernel/exit.c +++ b/kernel/exit.c @@ -950,8 +950,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);