public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Madore <david.madore@ens.fr>
To: Linux Kernel mailing-list <linux-kernel@vger.kernel.org>
Subject: Re: understanding Linux capabilities brokenness
Date: Tue, 9 Aug 2005 00:32:38 +0200	[thread overview]
Message-ID: <20050808223238.GA523@clipper.ens.fr> (raw)
In-Reply-To: <20050808211241.GA22446@clipper.ens.fr>

Sorry for replying to myself...

On Mon, Aug 08, 2005 at 09:13:06PM +0000, David Madore wrote:
> However, what I do not understand is precisely _how_ one gets a
> sendmail process without CAP_SETUID: for that is the heart of the
> problem, and that is where the bug really was.  But [#3] and [#4] are
> very obscure (and I found nothing conclusive in lkml archives).  I
> understand that the problem lies in some combination of the
> inheritable capability set and the CAP_SETPCAP capability, but I don't
> see what that combination is.  Certainly removing capabilities from
> the inheritable set should not prevent suid root programs from having
> them reinstated (in the language of [#6], the suid root bit should
> correspond to a full forced set of capabilities), so I don't see what
> that has to do with it, and CAP_SETPCAP indeed allows to remove
> capabilities from a given process but I don't see how the user could
> gain that capability (and indeed if he can then we can expect him to
> gain all capabilities very rapidly).

After some more intensive Googling, I found the answer in the archives
of the linux-privs-discuss mailing-list (whose existence I did not
know of):

<URL:
http://sourceforge.net/mailarchive/forum.php?thread_id=1588083&forum_id=25120
 >

The explanation from the sendmail team was incorrect: CAP_SETPCAP is a
red herring, it's only about CAP_SETUID, the implementation of the
inheritable set was broken in that it controlled not only capabilities
automatically passed across execve() but also those _gained_ by suid
root programs (contrary to the claim in the sendmail analysis) and,
worse, instead of failing on execve() when the program could not gain
privileges, it proceeded with the capabilities missing.  Hence the
catastrophic failure.

This does not tell me, then, why CAP_SETPCAP was globally disabled by
default, nor why passing of capabilities across execve() was entirely
removed instead of being fixed.

-- 
     David A. Madore
    (david.madore@ens.fr,
     http://www.madore.org/~david/ )

  reply	other threads:[~2005-08-08 22:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-08 21:12 understanding Linux capabilities brokenness David Madore
2005-08-08 22:32 ` David Madore [this message]
2005-08-08 23:53   ` David Wagner
2005-08-09  1:50     ` Theodore Ts'o
2005-08-09  4:46       ` James Morris
2005-08-09  8:09         ` Jan Engelhardt
2005-08-09 15:16         ` Christopher Warner
2005-08-09 20:20           ` Kyle Moffett
2005-08-09  4:59       ` David Madore
2005-08-09  5:53         ` James Morris

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=20050808223238.GA523@clipper.ens.fr \
    --to=david.madore@ens.fr \
    --cc=linux-kernel@vger.kernel.org \
    /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