Linux-audit Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: Paul Moore <paul@paul-moore.com>
Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] audit: catch errors from audit_filter_rules field checks
Date: Tue, 28 Jun 2016 13:29:21 -0400	[thread overview]
Message-ID: <20160628172921.GD30821@madcap2.tricolour.ca> (raw)
In-Reply-To: <CAHC9VhSdBr8oNCSYVHm0=DD=484SYw-CAK5-92Hf9uRm4Bj2cw@mail.gmail.com>

On 2016-06-16 17:07, Paul Moore wrote:
> On Tue, Jun 14, 2016 at 5:03 PM, Richard Guy Briggs <rgb@redhat.com> wrote:
> > In the case of an error returned from a field check in an audit filter
> > syscall rule, it is treated as a match and the rule action is honoured.
> >
> > This could cause a rule with a default of NEVER and an selinux field
> > check error to avoid logging.
> >
> > Recommend matching with an action of ALWAYS to catch malicious abuse of
> > this bug.  The downside of this approach is it could DoS the audit
> > subsystem.
> 
> I understand your concern about the DoS, but in reality it is no worse
> than if no audit filter rules were configured, yes?

Are you thinking of audit_filter_type which has now been merged with
audit_filter_user?

This is audit_filter_rules, which is used by syscalls with a much
broader choice of selectors.

If there are no rules set, there are no messages recorded other than
AVCs.  If a rule was configured and an error occurred in one of the
SELinux checks, it would match and not report.  I'd argue it should fail
safe and report.

> > Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> > ---
> >  kernel/auditsc.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> > index 71e14d8..6123672 100644
> > --- a/kernel/auditsc.c
> > +++ b/kernel/auditsc.c
> > @@ -683,6 +683,10 @@ static int audit_filter_rules(struct task_struct *tsk,
> >                 }
> >                 if (!result)
> >                         return 0;
> > +               if (result < 0) {
> > +                       *state = AUDIT_RECORD_CONTEXT;
> > +                       return 1;
> > +               }
> >         }
> >
> >         if (ctx) {
> 
> -- 
> paul moore
> www.paul-moore.com

- RGB

--
Richard Guy Briggs <rgb@redhat.com>
Kernel Security Engineering, Base Operating Systems, Red Hat
Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635

      parent reply	other threads:[~2016-06-28 17:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 21:03 [PATCH] audit: catch errors from audit_filter_rules field checks Richard Guy Briggs
2016-06-16 21:07 ` Paul Moore
2016-06-27 19:58   ` Paul Moore
2016-06-28 17:29   ` Richard Guy Briggs [this message]

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=20160628172921.GD30821@madcap2.tricolour.ca \
    --to=rgb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@paul-moore.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