All of lore.kernel.org
 help / color / mirror / Atom feed
From: paul@paul-moore.com (Paul Moore)
To: linux-security-module@vger.kernel.org
Subject: [RFC PATCH V2 0/4] capabilities: do not audit log BPRM_FCAPS on set*id
Date: Fri, 2 Jun 2017 15:30:01 -0400	[thread overview]
Message-ID: <CAHC9VhQ_G82fE++RySOK3OgW9y59=HsisRWB=zk2ZP7J_D-NEw@mail.gmail.com> (raw)
In-Reply-To: <20170602180356.GC6203@madcap2.tricolour.ca>

On Fri, Jun 2, 2017 at 2:03 PM, Richard Guy Briggs <rgb@redhat.com> wrote:
> On 2017-06-02 11:19, Paul Moore wrote:
>> On Thu, May 11, 2017 at 4:42 PM, Richard Guy Briggs <rgb@redhat.com> wrote:
>> > The audit subsystem is adding a BPRM_FCAPS record when auditing setuid
>> > application execution (SYSCALL execve). This is not expected as it was
>> > supposed to be limited to when the file system actually had capabilities
>> > in an extended attribute.  It lists all capabilities making the event
>> > really ugly to parse what is happening.  The PATH record correctly
>> > records the setuid bit and owner.  Suppress the BPRM_FCAPS record on
>> > set*id.
>> >
>> > See: https://github.com/linux-audit/audit-kernel/issues/16
>> >
>> > The patch that resolves this issue is the third.  The first and second just
>> > massage the logic to make it easier to understand.
>> >
>> > It would be possible to address the original issue with a change of
>> >         "!uid_eq(new->euid, root_uid) || !uid_eq(new->uid, root_uid)"
>> > to
>> >         "!(uid_eq(new->euid, root_uid) || uid_eq(new->uid, root_uid))"
>> > but it took me long enough to understand this logic that I don't think I'd be
>> > doing any favours by leaving it this difficult to understand.
>> >
>> > The final patch attempts to address all the conditions that need logging based
>> > on mailing list conversations, recoginizing there is probably some duplication
>> > in the logic, which is why I'm posting this as an RFC for some feedback.
>> >
>> > Richard Guy Briggs (4):
>> >   capabilities: use macros to make the logic easier to follow and
>> >     verify
>> >   capabilities: invert logic for clarity
>> >   capabilities: fix logic for effective root or real root
>> >   capabilities: auit log other surprising conditions
>> >
>> >  security/commoncap.c |   55 ++++++++++++++++++++++++++++++++-----------------
>> >  1 files changed, 36 insertions(+), 19 deletions(-)
>>
>> Following up on this set of patches ... I see there was some
>> discussion between you and Serge for one of the patches, but it isn't
>> clear to me that there was any resolution reached; where do things
>> stand at the moment?
>
> Well, I was still waiting to hear from you before submitting another
> round of patches.

All of the changes in this patchset relate to the capabilities code
and not the audit code so I don't really have a strong opinion.  Serge
knows way more about the subtleties of Linux capabilities than I do; I
trust his judgement there.

The only area I might want to weigh in on would be if/when we generate
records, but considering the rather vague answer from Steve when he
was asked about certification requirements, I'm not going to worry
about it too much right now.  Your logic outlined in the description
seems reasonable.

> I'd like to replace the macros with local variables (rather than
> funcitons), expecting that the compiler would be smarter than me and
> figure out the best way to do things.

Since that lives in the capabilities code and not the audit code that
is between you and Serge as far as I'm concerned.  I can send this up
via the audit tree if Serge would prefer, but I would want to see his
ACK.

-- 
paul moore
www.paul-moore.com
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Paul Moore <paul@paul-moore.com>
To: Richard Guy Briggs <rgb@redhat.com>,
	"Serge E. Hallyn" <serge.hallyn@ubuntu.com>
Cc: linux-security-module@vger.kernel.org, linux-audit@redhat.com,
	Andy Lutomirski <luto@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	James Morris <james.l.morris@oracle.com>,
	Eric Paris <eparis@redhat.com>, Paul Moore <pmoore@redhat.com>,
	Steve Grubb <sgrubb@redhat.com>
Subject: Re: [RFC PATCH V2 0/4] capabilities: do not audit log BPRM_FCAPS on set*id
Date: Fri, 2 Jun 2017 15:30:01 -0400	[thread overview]
Message-ID: <CAHC9VhQ_G82fE++RySOK3OgW9y59=HsisRWB=zk2ZP7J_D-NEw@mail.gmail.com> (raw)
In-Reply-To: <20170602180356.GC6203@madcap2.tricolour.ca>

On Fri, Jun 2, 2017 at 2:03 PM, Richard Guy Briggs <rgb@redhat.com> wrote:
> On 2017-06-02 11:19, Paul Moore wrote:
>> On Thu, May 11, 2017 at 4:42 PM, Richard Guy Briggs <rgb@redhat.com> wrote:
>> > The audit subsystem is adding a BPRM_FCAPS record when auditing setuid
>> > application execution (SYSCALL execve). This is not expected as it was
>> > supposed to be limited to when the file system actually had capabilities
>> > in an extended attribute.  It lists all capabilities making the event
>> > really ugly to parse what is happening.  The PATH record correctly
>> > records the setuid bit and owner.  Suppress the BPRM_FCAPS record on
>> > set*id.
>> >
>> > See: https://github.com/linux-audit/audit-kernel/issues/16
>> >
>> > The patch that resolves this issue is the third.  The first and second just
>> > massage the logic to make it easier to understand.
>> >
>> > It would be possible to address the original issue with a change of
>> >         "!uid_eq(new->euid, root_uid) || !uid_eq(new->uid, root_uid)"
>> > to
>> >         "!(uid_eq(new->euid, root_uid) || uid_eq(new->uid, root_uid))"
>> > but it took me long enough to understand this logic that I don't think I'd be
>> > doing any favours by leaving it this difficult to understand.
>> >
>> > The final patch attempts to address all the conditions that need logging based
>> > on mailing list conversations, recoginizing there is probably some duplication
>> > in the logic, which is why I'm posting this as an RFC for some feedback.
>> >
>> > Richard Guy Briggs (4):
>> >   capabilities: use macros to make the logic easier to follow and
>> >     verify
>> >   capabilities: invert logic for clarity
>> >   capabilities: fix logic for effective root or real root
>> >   capabilities: auit log other surprising conditions
>> >
>> >  security/commoncap.c |   55 ++++++++++++++++++++++++++++++++-----------------
>> >  1 files changed, 36 insertions(+), 19 deletions(-)
>>
>> Following up on this set of patches ... I see there was some
>> discussion between you and Serge for one of the patches, but it isn't
>> clear to me that there was any resolution reached; where do things
>> stand at the moment?
>
> Well, I was still waiting to hear from you before submitting another
> round of patches.

All of the changes in this patchset relate to the capabilities code
and not the audit code so I don't really have a strong opinion.  Serge
knows way more about the subtleties of Linux capabilities than I do; I
trust his judgement there.

The only area I might want to weigh in on would be if/when we generate
records, but considering the rather vague answer from Steve when he
was asked about certification requirements, I'm not going to worry
about it too much right now.  Your logic outlined in the description
seems reasonable.

> I'd like to replace the macros with local variables (rather than
> funcitons), expecting that the compiler would be smarter than me and
> figure out the best way to do things.

Since that lives in the capabilities code and not the audit code that
is between you and Serge as far as I'm concerned.  I can send this up
via the audit tree if Serge would prefer, but I would want to see his
ACK.

-- 
paul moore
www.paul-moore.com

  reply	other threads:[~2017-06-02 19:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 20:42 [RFC PATCH V2 0/4] capabilities: do not audit log BPRM_FCAPS on set*id Richard Guy Briggs
2017-05-11 20:42 ` Richard Guy Briggs
2017-05-11 20:42 ` [RFC PATCH V2 1/4] capabilities: use macros to make the logic easier to follow and verify Richard Guy Briggs
2017-05-11 20:42   ` Richard Guy Briggs
2017-05-12  5:35   ` Serge E. Hallyn
2017-05-12  5:35     ` Serge E. Hallyn
2017-05-12 11:37     ` Richard Guy Briggs
2017-05-12 11:37       ` Richard Guy Briggs
2017-05-12 13:50   ` Serge E. Hallyn
2017-05-12 13:50     ` Serge E. Hallyn
2017-05-11 20:42 ` [RFC PATCH V2 2/4] capabilities: invert logic for clarity Richard Guy Briggs
2017-05-11 20:42   ` Richard Guy Briggs
2017-05-11 20:42 ` [RFC PATCH V2 3/4] capabilities: fix logic for effective root or real root Richard Guy Briggs
2017-05-11 20:42   ` Richard Guy Briggs
2017-05-11 20:42 ` [RFC PATCH V2 4/4] capabilities: auit log other surprising conditions Richard Guy Briggs
2017-05-11 20:42   ` Richard Guy Briggs
2017-06-02 15:19 ` [RFC PATCH V2 0/4] capabilities: do not audit log BPRM_FCAPS on set*id Paul Moore
2017-06-02 15:19   ` Paul Moore
2017-06-02 18:03   ` Richard Guy Briggs
2017-06-02 18:03     ` Richard Guy Briggs
2017-06-02 19:30     ` Paul Moore [this message]
2017-06-02 19:30       ` Paul Moore

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='CAHC9VhQ_G82fE++RySOK3OgW9y59=HsisRWB=zk2ZP7J_D-NEw@mail.gmail.com' \
    --to=paul@paul-moore.com \
    --cc=linux-security-module@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.