mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Stephen Smalley" <sds@tycho.nsa.gov>
Cc: "Al Viro" <viro@ftp.linux.org.uk>, "Ingo Molnar" <mingo@elte.hu>,
	"Steve Grubb" <sgrubb@redhat.com>,
	"Andrew Morton" <akpm@osdl.org>,
	"James Morris" <jmorris@namei.org>,
	linux-kernel@vger.kernel.org,
	"Linus Torvalds" <torvalds@osdl.org>
Subject: Re: [PATCH 11/14] Reworked patch for labels on user space messages
Date: Wed, 3 May 2006 11:00:29 -0400	[thread overview]
Message-ID: <9e4733910605030800i4f7e7444qe63b5daee2f1773b@mail.gmail.com> (raw)
In-Reply-To: <1146667956.27735.73.camel@moss-spartans.epoch.ncsc.mil>

I can boot again with this patch...

On 5/3/06, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On Wed, 2006-05-03 at 15:28 +0100, Al Viro wrote:
> > On Wed, May 03, 2006 at 10:11:52AM -0400, Jon Smirl wrote:
> > > Something seems to be wrong in selinux_get_task_sid. I am getting
> > > thousands of these and can't boot the kernel.
> >
> > It's actually in security/selinux/hooks.c::selinux_disable() and gets
> > triggered if you have selinux enabled and explicitly disable afterwards.
> > Stephen Smalley had done a fix yesterday, basically adding
> >       selinux_enabled = 0;
> > after
> >         selinux_disabled = 1;
> > in there.  selinux_get_task_sid() happens to step on that in visible way
> > and nobody had caught that while this stuff was sitting in -mm ;-/
> >
> > The only question I have about that patch: what would happen if we do not
> > have CONFIG_SECURITY_SELINUX_BOOTPARAM?  In that case selinux_enabled is
> > defined to 1, so...
>
> Good point.  Ok, take two.
>
> [patch 1/1] selinux:  Clear selinux_enabled flag upon runtime disable.
>
> Clear selinux_enabled flag upon runtime disable of SELinux by userspace,
> and make sure it is defined even if selinux= boot parameter support is
> not enabled in configuration.
>
> Signed-off-by:  Stephen Smalley <sds@tycho.nsa.gov>
>
> ---
>
>  security/selinux/hooks.c            |    3 +++
>  security/selinux/include/security.h |    5 -----
>  2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff -X /home/sds/dontdiff -rup linux-2.6.17-rc3-mm1/security/selinux/hooks.c linux-2.6.17-rc3-mm1-x2/security/selinux/hooks.c
> --- linux-2.6.17-rc3-mm1/security/selinux/hooks.c       2006-05-02 09:08:02.000000000 -0400
> +++ linux-2.6.17-rc3-mm1-x2/security/selinux/hooks.c    2006-05-03 10:26:43.000000000 -0400
> @@ -101,6 +101,8 @@ static int __init selinux_enabled_setup(
>         return 1;
>  }
>  __setup("selinux=", selinux_enabled_setup);
> +#else
> +int selinux_enabled = 1;
>  #endif
>
>  /* Original (dummy) security module. */
> @@ -4535,6 +4537,7 @@ int selinux_disable(void)
>         printk(KERN_INFO "SELinux:  Disabled at runtime.\n");
>
>         selinux_disabled = 1;
> +       selinux_enabled = 0;
>
>         /* Reset security_ops to the secondary module, dummy or capability. */
>         security_ops = secondary_ops;
> diff -X /home/sds/dontdiff -rup linux-2.6.17-rc3-mm1/security/selinux/include/security.h linux-2.6.17-rc3-mm1-x2/security/selinux/include/security.h
> --- linux-2.6.17-rc3-mm1/security/selinux/include/security.h    2006-03-20 00:53:29.000000000 -0500
> +++ linux-2.6.17-rc3-mm1-x2/security/selinux/include/security.h 2006-05-03 10:25:39.000000000 -0400
> @@ -29,12 +29,7 @@
>  #define POLICYDB_VERSION_MIN   POLICYDB_VERSION_BASE
>  #define POLICYDB_VERSION_MAX   POLICYDB_VERSION_AVTAB
>
> -#ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM
>  extern int selinux_enabled;
> -#else
> -#define selinux_enabled 1
> -#endif
> -
>  extern int selinux_mls_enabled;
>
>  int security_load_policy(void * data, size_t len);
>
>
> --
> Stephen Smalley
> National Security Agency
>
>

--
Jon Smirl
jonsmirl@gmail.com

  parent reply	other threads:[~2006-05-03 15:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-01 10:30 Al Viro
2006-05-03 14:11 ` Jon Smirl
2006-05-03 14:28   ` Al Viro
2006-05-03 14:40     ` Jon Smirl
2006-05-03 14:53       ` Al Viro
2006-05-03 14:52     ` Stephen Smalley
2006-05-03 14:51       ` James Morris
2006-05-03 15:00       ` Jon Smirl [this message]
2006-05-03 16:55       ` Al Viro

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=9e4733910605030800i4f7e7444qe63b5daee2f1773b@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=akpm@osdl.org \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sds@tycho.nsa.gov \
    --cc=sgrubb@redhat.com \
    --cc=torvalds@osdl.org \
    --cc=viro@ftp.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®