mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Steve Grubb <sgrubb@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-audit@redhat.com, linux-kernel@vger.kernel.org,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] [BZ905179] audit: omit check for uid and gid validity in audit rules and data
Date: Wed, 10 Apr 2013 12:20:18 -0400	[thread overview]
Message-ID: <20130410162018.GE28504@madcap2.tricolour.ca> (raw)
In-Reply-To: <87vc7v1k2h.fsf@xmission.com>

On Tue, Apr 09, 2013 at 02:16:22PM -0700, Eric W. Biederman wrote:
> Steve Grubb <sgrubb@redhat.com> writes:
> 
> > On Tuesday, April 09, 2013 02:39:32 AM Eric W. Biederman wrote:
> >> Andrew Morton <akpm@linux-foundation.org> writes:
> >> > On Wed, 20 Mar 2013 15:18:17 -0400 Richard Guy Briggs <rgb@redhat.com> 
> > wrote:
> >> >> audit rule additions containing "-F auid!=4294967295" were failing with
> >> >> EINVAL.
> >> >> 
> >> >> UID_INVALID (and GID_INVALID) is actually a valid uid (gid) for setting
> >> >> and
> >> >> testing against audit rules.  Remove the check for invalid uid and gid
> >> >> when
> >> >> parsing rules and data for logging.
> >> 
> >> In general testing against invalid uid appears completely bogus, and
> >> should always return true.  As it is and essentially always has been
> >> incorrect to explicitly set any kernel uid to that value.
> >
> > This is the unset value that daemons would have. 
> 
> As their uid, or gid, or euid, or fsuid.  Not in the least.

Point taken that only a value of UID_INVALID should be accepted for
auid.

> > When a real person logs in, 
> > pam_loginuid writes the loginuid that was authenticated to. So, any time the 
> > value is -1, we are dealing with a daemon or system process. When it comes to 
> > auditing, people usually make an exception so that daemon and normal system 
> > activity is not recorded. So, you would make a rule something like
> 
> > -a always,exit -S open -F exit=-EPERM -F auid>=500 -F auid!=-1
> 
> My point is that -1 is a special case that applies only to loginuid, and
> that when testing for -1 is not testing for a specific loginuid value
> but instead it is testing to see if loginuid has been set.  Semantically
> the last is very different.
> 
> >> The only case where this appears to make the least little bit of sense
> >> is if the goal of the test is to test to see if an audit logloginuid
> >> has been set at all.  In which case depending on a test against
> >> 4294967295 is bogus because you are depending on an intimate internal
> >> kernel implementation detail.
> >
> > Its been this way and documented since at least 9 years ago. The audit system 
> > has been broken for all intents and purposes since the 3.7 kernel was 
> > released.
> 
> I certainly haven't seen the documentation.

It is in the audit manpages.

> And no one has much cared
> about the audit subsystem this "breakage" of the audit
> subsystem. Despite things failing with a clear error code.  So there are
> two choices.  We mark the audit subsystem as broken moving it to staging
> and then delete it because no one cares enough to look after it and
> maintain it.  Or we have a constructive conversation about what to do
> with it.

Ok, politics aside...

> I have proposed a patch that will preserve the existing behavior while
> adding maintainable semantics.  Will someone who cares please test my
> proposed fix?

I'll test it.

> Eric

- RGB

--
Richard Guy Briggs <rbriggs@redhat.com>
Senior Software Engineer
AMER ENG Base Operating Systems
Remote, Canada, Ottawa
Voice: 1.647.777.2635
Internal: (81) 32635

  reply	other threads:[~2013-04-10 16:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 19:18 Richard Guy Briggs
2013-04-08 23:46 ` Andrew Morton
2013-04-09  9:39   ` Eric W. Biederman
2013-04-09 20:15     ` Richard Guy Briggs
2013-04-10 18:02       ` Eric W. Biederman
2013-04-10 18:46         ` Richard Guy Briggs
2013-04-09 20:39     ` Steve Grubb
2013-04-09 21:16       ` Eric W. Biederman
2013-04-10 16:20         ` Richard Guy Briggs [this message]
2013-04-10 17:35           ` Richard Guy Briggs
2013-04-16 19:38     ` Richard Guy Briggs
2013-05-09 13:29       ` Steve Grubb
2013-05-09 13:52         ` Richard Guy Briggs
2013-05-09 15:10           ` Richard Guy Briggs
2013-05-13  1:22         ` Eric Paris

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=20130410162018.GE28504@madcap2.tricolour.ca \
    --to=rgb@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgrubb@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®