mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: linux-kernel@vger.kernel.org, linux-audit@redhat.com
Cc: Richard Guy Briggs <rgb@redhat.com>
Subject: [PATCH] [BZ905179] audit: omit check for uid and gid validity in audit rules and data
Date: Wed, 20 Mar 2013 15:18:17 -0400	[thread overview]
Message-ID: <1363807097-13073-1-git-send-email-rgb@redhat.com> (raw)

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.

Revert part of ca57ec0f00c3f139c41bf6b0a5b9bcc95bbb2ad7 (2012-09-11) to fix
this.

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
---
 kernel/auditfilter.c |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index f9fc54b..457ee39 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -360,10 +360,7 @@ static struct audit_entry *audit_rule_to_entry(struct audit_rule *rule)
 			/* bit ops not implemented for uid comparisons */
 			if (f->op == Audit_bitmask || f->op == Audit_bittest)
 				goto exit_free;
-
 			f->uid = make_kuid(current_user_ns(), f->val);
-			if (!uid_valid(f->uid))
-				goto exit_free;
 			break;
 		case AUDIT_GID:
 		case AUDIT_EGID:
@@ -372,10 +369,7 @@ static struct audit_entry *audit_rule_to_entry(struct audit_rule *rule)
 			/* bit ops not implemented for gid comparisons */
 			if (f->op == Audit_bitmask || f->op == Audit_bittest)
 				goto exit_free;
-
 			f->gid = make_kgid(current_user_ns(), f->val);
-			if (!gid_valid(f->gid))
-				goto exit_free;
 			break;
 		case AUDIT_PID:
 		case AUDIT_PERS:
@@ -469,10 +463,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
 			/* bit ops not implemented for uid comparisons */
 			if (f->op == Audit_bitmask || f->op == Audit_bittest)
 				goto exit_free;
-
 			f->uid = make_kuid(current_user_ns(), f->val);
-			if (!uid_valid(f->uid))
-				goto exit_free;
 			break;
 		case AUDIT_GID:
 		case AUDIT_EGID:
@@ -482,10 +473,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
 			/* bit ops not implemented for gid comparisons */
 			if (f->op == Audit_bitmask || f->op == Audit_bittest)
 				goto exit_free;
-
 			f->gid = make_kgid(current_user_ns(), f->val);
-			if (!gid_valid(f->gid))
-				goto exit_free;
 			break;
 		case AUDIT_PID:
 		case AUDIT_PERS:
-- 
1.7.1


             reply	other threads:[~2013-03-20 19:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 19:18 Richard Guy Briggs [this message]
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
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=1363807097-13073-1-git-send-email-rgb@redhat.com \
    --to=rgb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@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 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®