public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Amy Griffis <amy.griffis@hp.com>
To: Steve Grubb <sgrubb@redhat.com>
Cc: linux-audit@redhat.com
Subject: Re: another issue with Audit
Date: Mon, 24 Apr 2006 14:07:06 -0400	[thread overview]
Message-ID: <20060424180706.GA19641@zk3.dec.com> (raw)
In-Reply-To: <200604241159.33747.sgrubb@redhat.com>

On Mon, Apr 24, 2006 at 11:59:33AM -0400, Steve Grubb wrote:
> On Monday 24 April 2006 11:51, Linda Knippers wrote:
> > That's really strange. ?I'm running the .16 kernel and the audit-1.2
> > audit tools on an x86 and I'm not seeing the problem. ?I'll upgrade and
> > see what happens.
> 
> I see the same probelm that Loulwa is reporting on .18 kernel.

Hmm.  Looks like the filesystem audit patches didn't make it into the
.18 kernel.  The kernel doesn't reject field types it doesn't know
about, so it's adding the rule with field type 105 and value
strlen(path). 

diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index d3a8539..63aa039 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
[..]
@@ -188,8 +211,9 @@ static struct audit_entry *audit_data_to
 	int err = 0;
 	struct audit_entry *entry;
 	void *bufp;
-	/* size_t remain = datasz - sizeof(struct audit_rule_data); */
+	size_t remain = datasz - sizeof(struct audit_rule_data);
 	int i;
+	char *str;
 
 	entry = audit_to_entry_common((struct audit_rule *)data);
 	if (IS_ERR(entry))
@@ -207,10 +231,35 @@ static struct audit_entry *audit_data_to
 
 		f->op = data->fieldflags[i] & AUDIT_OPERATORS;
 		f->type = data->fields[i];
+		f->val = data->values[i];
+		f->se_str = NULL;
+		f->se_rule = NULL;
 		switch(f->type) {
-		/* call type-specific conversion routines here */
-		default:
-			f->val = data->values[i];
+		case AUDIT_SE_USER:
+		case AUDIT_SE_ROLE:
+		case AUDIT_SE_TYPE:
+		case AUDIT_SE_SEN:
+		case AUDIT_SE_CLR:
+			str = audit_unpack_string(&bufp, &remain, f->val);
+			if (IS_ERR(str))
+				goto exit_free;
+			entry->rule.buflen += f->val;
+
+			err = selinux_audit_rule_init(f->type, f->op, str,
+						      &f->se_rule);
+			/* Keep currently invalid fields around in case they
+			 * become valid after a policy reload. */
+			if (err == -EINVAL) {
+				printk(KERN_WARNING "audit rule for selinux "
+				       "\'%s\' is invalid\n",  str);
+				err = 0;
+			}
+			if (err) {
+				kfree(str);
+				goto exit_free;
+			} else
+				f->se_str = str;
+			break;
 		}
 	}
 

      parent reply	other threads:[~2006-04-24 18:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24 15:21 another issue with Audit Loulwa Salem
2006-04-24 15:51 ` Linda Knippers
2006-04-24 15:59   ` Steve Grubb
2006-04-24 16:04     ` Loulwa Salem
2006-04-24 18:07     ` Amy Griffis [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=20060424180706.GA19641@zk3.dec.com \
    --to=amy.griffis@hp.com \
    --cc=linux-audit@redhat.com \
    --cc=sgrubb@redhat.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