public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Roland McGrath <roland@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Chris Evans <scarybeasts@gmail.com>,
	David Howells <dhowells@redhat.com>,
	Don Howard <dhoward@redhat.com>, Eugene Teo <eugene@redhat.com>,
	Michael Kerrisk <mtk.manpages@googlemail.com>,
	Tavis Ormandy <taviso@sdf.lonestar.org>,
	Vitaly Mayatskikh <vmayatsk@redhat.com>,
	stable@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] exit_notify: kill the wrong capable(CAP_KILL) check
Date: Wed, 25 Feb 2009 17:54:09 -0600	[thread overview]
Message-ID: <20090225235409.GA2443@hallyn.com> (raw)
In-Reply-To: <20090225231645.GA17868@redhat.com>

Quoting Oleg Nesterov (oleg@redhat.com):
> On 02/25, Serge E. Hallyn wrote:
> >
> > Quoting Oleg Nesterov (oleg@redhat.com):
> > > On 02/25, Serge E. Hallyn wrote:
> > > >
> > > > Quoting Oleg Nesterov (oleg@redhat.com):
> > > > > On 02/25, Serge E. Hallyn wrote:
> > > > > Can't understand... Why do you think CAP_KILL makes things better?
> > > > >
> > > > > Actually, how can it make any difference in this case?
> > > >
> > > > Well the check by itself isn't quite right - it seems to me it
> > > > should also check whether tsk->euid == parent->uid.  But letting
> > > > an unprivileged task send SIGSTOP to a privileged one bc of
> > > > some fluke in the task hierarchy doesn't seem right.
> > >
> > > I think you misread this CAP_KILL check.
> > >
> > > It does not restrict the unprivileged task to send the signal. Instead,
> > > if the exiting task has CAP_KILL, we bypass other security checks.
> >
> > ?  If the exiting task does not have CAP_KILL,
> 
> _and_ (not "or") the execution domains for parent/chils are different,
> 
> > we set the signal to
> > SIGCHILD (which is deemed safe).
> 
> Yes. So why we should not set the signal to SIGCHLD if the task has
> CAP_KILL ?

Yeah, you're right,  I wasn't thinking right.

> And again, the malicious application can exec the setuid binary before
> exit, in this case we never reset ->exit_signal (of course, unless
> that binary drops CAP_KILL).

Heh, thanks for taking the time to set me straight.

Acked-by: Serge Hallyn <serue@us.ibm.com>

Thanks.

-serge

  reply	other threads:[~2009-02-25 23:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 19:02 [PATCH 2/2] exit_notify: kill the wrong capable(CAP_KILL) check Oleg Nesterov
2009-02-25 19:41 ` Roland McGrath
2009-02-25 21:53   ` Serge E. Hallyn
2009-02-25 22:03     ` Oleg Nesterov
2009-02-25 22:14       ` Serge E. Hallyn
2009-02-25 22:32         ` Oleg Nesterov
2009-02-25 22:47           ` Serge E. Hallyn
2009-02-25 23:16             ` Oleg Nesterov
2009-02-25 23:54               ` Serge E. Hallyn [this message]
2009-04-06 14:16 ` [PATCH, RESEND] " Oleg Nesterov
2009-04-06 19:36   ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090225235409.GA2443@hallyn.com \
    --to=serge@hallyn.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dhoward@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=eugene@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@googlemail.com \
    --cc=oleg@redhat.com \
    --cc=roland@redhat.com \
    --cc=scarybeasts@gmail.com \
    --cc=stable@kernel.org \
    --cc=taviso@sdf.lonestar.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vmayatsk@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox