From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761553AbZBYWHM (ORCPT ); Wed, 25 Feb 2009 17:07:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751916AbZBYWG6 (ORCPT ); Wed, 25 Feb 2009 17:06:58 -0500 Received: from mx2.redhat.com ([66.187.237.31]:53784 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751334AbZBYWG5 (ORCPT ); Wed, 25 Feb 2009 17:06:57 -0500 Date: Wed, 25 Feb 2009 23:03:24 +0100 From: Oleg Nesterov To: "Serge E. Hallyn" Cc: Roland McGrath , Andrew Morton , Linus Torvalds , Alan Cox , Chris Evans , David Howells , Don Howard , Eugene Teo , Michael Kerrisk , Tavis Ormandy , Vitaly Mayatskikh , stable@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] exit_notify: kill the wrong capable(CAP_KILL) check Message-ID: <20090225220324.GA14667@redhat.com> References: <20090225190218.GA7453@redhat.com> <20090225194140.D6F6EFC3DA@magilla.sf.frob.com> <20090225215356.GA1442@hallyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090225215356.GA1442@hallyn.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/25, Serge E. Hallyn wrote: > > Quoting Roland McGrath (roland@redhat.com): > > > I can't understand why exit_notify() checks capable(CAP_KILL), but this > > > looks just wrong. > > > > I don't know either why it's there. My guess is that it was not actually > > thought out specifically, just a "unless capable" exception added when the > > security-motivated exclusions (exec_id stuff) were added. > > > > I can't think of any reason not to drop this check. > > Because of the following test? > > #include > #include > #include > #include > > int childfn(void *data) > { > printf("hi there, i'm the child\n"); > sleep(10); > exit(0); > } > > int main() > { > int stacksize = 4*getpagesize(); > void *stack, *stacktop; > > stack = malloc(stacksize); > stacktop = stack + stacksize; > > int p = clone(childfn, stacktop, CLONE_PARENT|SIGSTOP, NULL); > exit(0); > } Can't understand... Why do you think CAP_KILL makes things better? Actually, how can it make any difference in this case? Oleg.