From: James Morris <jmorris@namei.org>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: "Christopher J. PeBenito" <cpebenito@tresys.com>,
selinux@tycho.nsa.gov, Eamon Walsh <ewalsh@tycho.nsa.gov>,
Eric Paris <eparis@parisplace.org>,
Chad Sellers <csellers@tresys.com>
Subject: Re: Expunging userspace classes and permissions from kernel headers
Date: Fri, 23 Mar 2007 14:34:18 -0400 (EDT) [thread overview]
Message-ID: <Line.LNX.4.64.0703231434090.30602@d.namei> (raw)
In-Reply-To: <1174667120.31436.232.camel@moss-spartans.epoch.ncsc.mil>
On Fri, 23 Mar 2007, Stephen Smalley wrote:
> Yes, looks sane. We would then apply that diff (re-based to the kernel
> tree) along with a patch like the following untested one (added a guard
> to both avc_dump_query and validate_classes despite my earlier comment).
> Look reasonable to others?
Yep.
>
> diff --git a/security/selinux/avc.c b/security/selinux/avc.c
> index da8caf1..b25cf18 100644
> --- a/security/selinux/avc.c
> +++ b/security/selinux/avc.c
> @@ -217,7 +217,9 @@ static void avc_dump_query(struct audit_buffer *ab, u32 ssid, u32 tsid, u16 tcla
> audit_log_format(ab, " tcontext=%s", scontext);
> kfree(scontext);
> }
> - audit_log_format(ab, " tclass=%s", class_to_string[tclass]);
> +
> + if (tclass && tclass < ARRAY_SIZE(class_to_string))
> + audit_log_format(ab, " tclass=%s", class_to_string[tclass]);
> }
>
> /**
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
> index 1e52356..3668f18 100644
> --- a/security/selinux/ss/services.c
> +++ b/security/selinux/ss/services.c
> @@ -1050,6 +1050,8 @@ static int validate_classes(struct policydb *p)
>
> for (i = 1; i < kdefs->cts_len; i++) {
> def_class = kdefs->class_to_string[i];
> + if (!def_class)
> + continue;
> if (i > p->p_classes.nprim) {
> printk(KERN_INFO
> "security: class %s not defined in policy\n",
>
>
>
--
James Morris
<jmorris@namei.org>
--
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.
next prev parent reply other threads:[~2007-03-23 18:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-22 13:24 Expunging userspace classes and permissions from kernel headers Stephen Smalley
2007-03-22 13:46 ` Christopher J. PeBenito
2007-03-22 13:50 ` Stephen Smalley
2007-03-22 17:25 ` Christopher J. PeBenito
2007-03-22 17:51 ` Stephen Smalley
2007-03-23 16:09 ` Christopher J. PeBenito
2007-03-23 16:25 ` Stephen Smalley
2007-03-23 18:34 ` James Morris [this message]
2007-03-23 18:41 ` Eric Paris
2007-03-23 18:50 ` Stephen Smalley
2007-03-23 19:37 ` Christopher J. PeBenito
2007-03-26 15:23 ` Stephen Smalley
2007-03-26 17:40 ` Stephen Smalley
2007-03-30 19:44 ` Stephen Smalley
2007-03-30 20:30 ` Christopher J. PeBenito
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=Line.LNX.4.64.0703231434090.30602@d.namei \
--to=jmorris@namei.org \
--cc=cpebenito@tresys.com \
--cc=csellers@tresys.com \
--cc=eparis@parisplace.org \
--cc=ewalsh@tycho.nsa.gov \
--cc=sds@tycho.nsa.gov \
--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.