linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: "Andrew G. Morgan" <morgan@kernel.org>
Cc: LSM List <linux-security-module@vger.kernel.org>
Subject: Re: [PATCH 12/15] Manual pages: cap_get_file.3: NOTES: note the effect of the Ambient set
Date: Mon, 20 Jul 2020 22:21:55 +0200	[thread overview]
Message-ID: <CAKgNAkh=oa2Rv-sfsY3mNsvUdTi5sO0hvY9PSQTGCraJ=3+3eA@mail.gmail.com> (raw)
In-Reply-To: <CALQRfL5-aL3h6M+CYqkVHSpPKQ-i3s+RWD8060AicrGPP3vSfw@mail.gmail.com>

Hi Andrew,

On Mon, 20 Jul 2020 at 17:36, Andrew G. Morgan <morgan@kernel.org> wrote:
>
> I've applied all but this one. This one seems to imply that if the
> effective bit is lowered, but the permitted bits are raised, the
> ambient will have some sort of effect. This isn't how it works. Any
> file caps (even an empty set) suppresses any effect of the ambient
> vector.

Thanks for catching that. I was trying to capture this piece of the
execve() transformation rules:

P'(effective)   = F(effective) ? P'(permitted) : P'(ambient)

But of course, I failed to capture the detail that it is the process's
*new* ambient set (which, as you note, is cleared if the file has any
attached capabilities) that is assigned to the effective set. Perhaps
the text is best left as is. If I have some better idea, I'll come
back to you.

Thanks,

Michael

> On Mon, Jul 20, 2020 at 2:14 AM Michael Kerrisk (man-pages)
> <mtk.manpages@gmail.com> wrote:
> >
> > The addition of Ambient capabilities in Linux 4.3 rendered the text on
> > the effect of the Effective bit during execve(2) out-of-date. Fix that.
> > Also add a couple of paragraph breaks to improve readability.
> >
> > Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
> > ---
> >  doc/cap_get_file.3 | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/doc/cap_get_file.3 b/doc/cap_get_file.3
> > index ceacbaf..dc7b571 100644
> > --- a/doc/cap_get_file.3
> > +++ b/doc/cap_get_file.3
> > @@ -103,13 +103,18 @@ or
> >  These functions are specified by withdrawn POSIX.1e draft specification.
> >  .SH NOTES
> >  Support for file capabilities is provided on Linux since version 2.6.24.
> > -
> > +.PP
> >  On Linux, the file Effective set is a single bit.
> >  If it is enabled, then all Permitted capabilities are enabled
> >  in the Effective set of the calling process when the file is executed;
> > -otherwise, no capabilities are enabled in the process's Effective set
> > +otherwise, the process's Ambient capabilities
> > +(or, before the Linux 4.3 addition of Ambient capabilities, no capabilities)
> > +are enabled in the process's Effective set
> >  following an
> > -.BR execve (2).
> > +.BR execve (2)
> > +(see
> > +.BR capabilities (7)).
> > +.PP
> >  Because the file Effective set is a single bit,
> >  if any capability is enabled in the Effective set of the
> >  .I cap_t
> > --
> > 2.26.2
> >



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

  reply	other threads:[~2020-07-20 20:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20  9:13 [PATCH 00/15] [libcap] Manual pages: various fixes Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 01/15] Manual pages: various pages: Use "\-" for real minus signs Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 02/15] Manual pages: cap_init.3: Formatting fix Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 03/15] Manual pages: capsh.1: Various minor wording and formatting fixes Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 04/15] Manual pages: cap_copy_ext.3: Typo fix Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 05/15] Manual pages; cap_get_file.3: Fix some clumsily worded text Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 06/15] Manual pages: getcap.8: Add missing word Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 07/15] Manual pages: getcap.8: Fix a clumsily worded sentence Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 08/15] Manual pages: getpcaps.8: Format options as a hanging list Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 09/15] Manual pages: getpcaps.8: Remove a stray .br macro Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 10/15] Manual pages: getpcaps.8: SEE ALSO: fix section number for capsh Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 11/15] Manual pages: setcap.8: Typo fix Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 12/15] Manual pages: cap_get_file.3: NOTES: note the effect of the Ambient set Michael Kerrisk (man-pages)
2020-07-20 15:36   ` Andrew G. Morgan
2020-07-20 20:21     ` Michael Kerrisk (man-pages) [this message]
2020-07-20  9:13 ` [PATCH 13/15] Manual pages: cap_get_proc.3: Update description of capsetp() Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 14/15] Manual pages: cap_get_proc.3, capsh.1: Use "UID" and "GID" consistently Michael Kerrisk (man-pages)
2020-07-20  9:13 ` [PATCH 15/15] Manual pages: capsh.1: Change .TP indent to the default Michael Kerrisk (man-pages)

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='CAKgNAkh=oa2Rv-sfsY3mNsvUdTi5sO0hvY9PSQTGCraJ=3+3eA@mail.gmail.com' \
    --to=mtk.manpages@gmail.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=morgan@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;
as well as URLs for NNTP newsgroup(s).