From: "Serge E. Hallyn" <serge@hallyn.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Serge E. Hallyn" <serge@hallyn.com>,
Christoph Lameter <cl@linux.com>,
"Andrew G. Morgan" <morgan@kernel.org>,
Serge Hallyn <serge.hallyn@ubuntu.com>,
Serge Hallyn <serge.hallyn@canonical.com>,
Jonathan Corbet <corbet@lwn.net>,
Aaron Jones <aaronmdjones@gmail.com>, "Ted Ts'o" <tytso@mit.edu>,
LSM List <linux-security-module@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linuxfoundation.org>
Subject: Re: [RFC] Implement ambient capability set.
Date: Thu, 5 Feb 2015 01:03:09 +0100 [thread overview]
Message-ID: <20150205000309.GA23013@mail.hallyn.com> (raw)
In-Reply-To: <CALCETrUe1S9k7XE_LpsagnVPSOSvMRpWSLyB4rKoLqAGYgzvfw@mail.gmail.com>
Quoting Andy Lutomirski (luto@amacapital.net):
> On Wed, Feb 4, 2015 at 2:02 PM, Serge E. Hallyn <serge@hallyn.com> wrote:
> > Quoting Serge E. Hallyn (serge@hallyn.com):
> >> Quoting Andy Lutomirski (luto@amacapital.net):
> >> > On Wed, Feb 4, 2015 at 1:27 PM, Serge E. Hallyn <serge@hallyn.com> wrote:
> >> > > Quoting Andy Lutomirski (luto@amacapital.net):
> >> > >> On Wed, Feb 4, 2015 at 1:16 PM, Serge E. Hallyn <serge@hallyn.com> wrote:
> >> > >> > Quoting Andy Lutomirski (luto@amacapital.net):
> >> > >> >> On Wed, Feb 4, 2015 at 10:49 AM, Christoph Lameter <cl@linux.com> wrote:
> >> > >> >> > +
> >> > >> >> > + if (!cap_valid(arg2))
> >> > >> >> > + return -EINVAL;
> >> > >> >> > +
> >> > >> >> > + new =prepare_creds();
> >> > >> >> > + if (arg3 == 0)
> >> > >> >> > + cap_lower(new->cap_ambient, arg2);
> >> > >> >> > + else
> >> > >> >> > + cap_raise(new->cap_ambient, arg2);
> >> > >> >> > + return commit_creds(new);
> >> > >> >> > +
> >> > >> >>
> >> > >> >> This let you add capabilities you don't even have to cap_ambient. I'm
> >> > >> >> fine with that as long as the cap evolution rule changes, as above.
> >> > >> >
> >> > >> > How about if instead we do restrict it to what's in pP? I don't
> >> > >> > want CAP_SETPCAP to become a cheap way to get all caps back. With
> >> > >> > or without NNP.
> >> > >>
> >> > >> We'd also have to modify everything that can change pP to change pA as
> >> > >> well if we went this route. I'd be okay with that, but it would make
> >> > >> the patch much larger, and I'm not entirely sure I see the benefit.
> >> > >> It would keep the number of possible states smaller, which could be
> >> > >> nice.
> >> > >
> >> > > Do you mean if we didn't require NNP? I'm suggesting that even if
> >> > > we require NNP we should restrict any new bits added to pA to be
> >> > > in pP at the prctl call. Then whether or not to drop them from
> >> > > pA when they are dropped from pP, I'm not yet certain.
> >> >
> >> > I mean regardless of whether we require NNP.
> >> >
> >> > I think that, unless we change the evolution rule, we would need to
> >> > drop from pA when bits are dropped from pP to preserve the idea that
> >> > dropping bits from pP drops them for good (as long as ruid != 0 or
> >> > some securebit is set).
> >>
> >> Ok, so iiuc the rules would be:
> >>
> >> 1. must set nnp and have ns_capable(CAP_SETPCAP) to
> >> call prctl(PR_SET_AMBIENT_WHATEVER)
> >>
> >> 2. adding bits to pA requires they be in pP at prctl time
> >>
> >> 3. dropping bits from pP drops them also from pA
>
> I'm still unconvinced that 2 and 3 is better than using pP & pA in
> execve, but I could go either way on that.
>
> >>
> >> 4. at exec, fP |= pA; pA' = pA
> >
> > Actually I'm tempted to say that if fP is not empty, then we stick with current
> > rules for fP/pP and clear out pA. If fP is empty, then fP = pA
> >
> > Then, if fP is not empty on the file, we either drop nnp at exec (or
> > don't use nnp at all), or we refuse exec if fP > pA.
>
> We can't drop nnp at exec.
>
> >
> > We definately do not want to run a file which has capability X
> > in fP, when X is not in pA.
>
> Confused. This will break everything, including Christoph's use case.
> The status quo for running ping from bash has pA == 0 and fP != 0.
Sorry, I meant only if pA is not empty.
But it sounds like we've in any case not hit on anything that will
actually work for Christoph.
next prev parent reply other threads:[~2015-02-05 0:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 18:49 [RFC] Implement ambient capability set Christoph Lameter
2015-02-04 20:44 ` Andy Lutomirski
2015-02-04 21:16 ` Serge E. Hallyn
2015-02-04 21:24 ` Andy Lutomirski
2015-02-04 21:27 ` Serge E. Hallyn
2015-02-04 21:31 ` Andy Lutomirski
2015-02-04 21:51 ` Serge E. Hallyn
2015-02-04 22:02 ` Serge E. Hallyn
2015-02-04 22:32 ` Andy Lutomirski
2015-02-05 0:03 ` Serge E. Hallyn [this message]
2015-02-04 21:57 ` Christoph Lameter
2015-02-04 22:29 ` Andy Lutomirski
2015-02-04 21:51 ` Christoph Lameter
2015-02-04 21:56 ` Andy Lutomirski
2015-02-04 22:01 ` Christoph Lameter
2015-02-04 22:02 ` [RFC] Implement ambient capability set V2 Christoph Lameter
2015-02-05 7:20 ` [RFC] Implement ambient capability set Michael Kerrisk
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=20150205000309.GA23013@mail.hallyn.com \
--to=serge@hallyn.com \
--cc=aaronmdjones@gmail.com \
--cc=akpm@linuxfoundation.org \
--cc=cl@linux.com \
--cc=corbet@lwn.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=morgan@kernel.org \
--cc=serge.hallyn@canonical.com \
--cc=serge.hallyn@ubuntu.com \
--cc=tytso@mit.edu \
/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