Re: [PATCH BUGFIX -rc3] Smack: Don't register smackfs if we're not loaded

From: Casey Schaufler
Date: Tue Mar 04 2008 - 12:45:22 EST


----- Original Message ----
> From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> To: Ahmed S. Darwish <darwish.07@xxxxxxxxx>
> Cc: Casey Schaufler <casey@xxxxxxxxxxxxxxxx>; LKML <linux-kernel@xxxxxxxxxxxxxxx>
> Sent: Tuesday, March 4, 2008 9:21:19 AM
> Subject: Re: [PATCH BUGFIX -rc3] Smack: Don't register smackfs if we're not loaded
>
>
>
> On Tue, 4 Mar 2008, Ahmed S. Darwish wrote:
> >
> > Smackfs initialization without an enabled Smack leads to
> > an early Oops that renders the system unusable.
>
> I really think this is bogus. Global enables like this are just wrong, and
> a sign that something else bad is going on.
>
> What is the oops? Why does it happen?

A kernel that is built with both SELinux and Smack contains
all of the components for both, including smackfs. If SELinux
is chosen as the module to be used and smackfs is initialized
the oops occurs because the Smack initialization that smackfs
depends on has not been done.

One solution would be to tighten the smackfs code so that it
handles the uninitialized LSM case properly.

Another would be to set up Kconfig as to make SELinux and Smack
mutually exclusive, although I really don't know how well that
would go over in testing circles because "config all on" becomes
ambiguous.

A third would be to provide for stacking, but I assume that's
beyond the scope of this exercise.

So I think that fixing up smackfs is the right choice at this point.

>
>
> Linus




Casey Schaufler
casey@xxxxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/