From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763124AbZD2Wme (ORCPT ); Wed, 29 Apr 2009 18:42:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760643AbZD2WWA (ORCPT ); Wed, 29 Apr 2009 18:22:00 -0400 Received: from kroah.org ([198.145.64.141]:40757 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758928AbZD2WVv (ORCPT ); Wed, 29 Apr 2009 18:21:51 -0400 X-Mailbox-Line: From gregkh@mini.kroah.org Wed Apr 29 15:09:30 2009 Message-Id: <20090429220930.548659812@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Wed, 29 Apr 2009 15:07:50 -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 51/58] exit_notify: kill the wrong capable(CAP_KILL) check (CVE-2009-1337) References: <20090429220659.339950874@mini.kroah.org> Content-Disposition: inline; filename=exit_notify-kill-the-wrong-capable-check.patch In-Reply-To: <20090429221657.GA11765@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2.6.27-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 @@ -938,8 +938,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);