All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Justin Mattock <justinmattock@gmail.com>
Cc: SE-Linux <selinux@tycho.nsa.gov>, Eric Paris <eparis@parisplace.org>
Subject: Re: RIP: 0010:[<ffffffff811bdec1>] [<ffffffff811bdec1>] avc_audit_post_callback+0xc6/0xfe
Date: Fri, 25 Feb 2011 09:07:40 -0500	[thread overview]
Message-ID: <1298642860.13368.15.camel@moss-pluto> (raw)
In-Reply-To: <AANLkTi=UYvBV9piRpUapcf+6gFyJpOg8yAxt0NG9J_Re@mail.gmail.com>

On Thu, 2011-02-24 at 12:57 -0800, Justin Mattock wrote:
> this just popped up..:
> 
> 
> [29804.908327] SELinux:  Invalid class 3588
> [29804.908438] ------------[ cut here ]------------
> [29804.908443] kernel BUG at security/selinux/avc.c:162!

It might help debugging to get as much of the AVC message as we can even
in this case, e.g.

diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index 9da6420..8c0ad28 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -111,6 +111,11 @@ static void avc_dump_av(struct audit_buffer *ab, u16 tclass, u32 av)
 		return;
 	}
 
+	if (tclass >= ARRAY_SIZE(secclass_map)) {
+		audit_log_format(ab, " 0x%x", av);
+		return;
+	}
+
 	perms = secclass_map[tclass-1].perms;
 
 	audit_log_format(ab, " {");
@@ -159,8 +164,10 @@ static void avc_dump_query(struct audit_buffer *ab, u32 ssid, u32 tsid, u16 tcla
 		kfree(scontext);
 	}
 
-	BUG_ON(tclass >= ARRAY_SIZE(secclass_map));
-	audit_log_format(ab, " tclass=%s", secclass_map[tclass-1].name);
+	if (tclass < ARRAY_SIZE(secclass_map)) 
+	  audit_log_format(ab, " tclass=%s", secclass_map[tclass-1].name);
+	else
+	  audit_log_format(ab, " tclass=%d", tclass);
 }
 
 /**


-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  parent reply	other threads:[~2011-02-25 14:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24 20:57 RIP: 0010:[<ffffffff811bdec1>] [<ffffffff811bdec1>] avc_audit_post_callback+0xc6/0xfe Justin Mattock
2011-02-24 20:57 ` Justin Mattock
2011-02-24 22:51 ` cto
2011-02-25  3:29   ` Eric Paris
2011-02-25  4:18     ` Justin Mattock
2011-02-25  4:16   ` Justin Mattock
2011-02-25 14:07 ` Stephen Smalley [this message]
2011-02-25 17:18   ` Justin Mattock
2011-02-26  3:51     ` Ethan Heidrick
2011-02-26  9:16       ` cto
2011-03-24 14:01     ` Stephen Smalley
2011-03-24 16:28       ` Justin P. Mattock
2011-03-24 21:21       ` Justin P. Mattock

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=1298642860.13368.15.camel@moss-pluto \
    --to=sds@tycho.nsa.gov \
    --cc=eparis@parisplace.org \
    --cc=justinmattock@gmail.com \
    --cc=selinux@tycho.nsa.gov \
    /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.