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

From: Linus Torvalds
Date: Tue Mar 04 2008 - 13:13:45 EST




On Tue, 4 Mar 2008, Casey Schaufler wrote:
>
> One solution would be to tighten the smackfs code so that it
> handles the uninitialized LSM case properly.

I really would tend to prefer that.

We had a very similar situation in the ACPI/WMI code, where some WMI
helper routines would crash just because the WMI data structures hadn't
been initialized.

The proper fix in that case (in my opinion, and the one that thus got
committed ;^) was simply to make sure that the data structures were simply
always consistent (and empty), even if the code itself was disabled. That
just automatically meant that it didn't need any global flags to be
tested.

So _if_ the alternative is as simple as just making sure that smackfs
keeps its data structures consistent even when disabled, I think that's
the right patch, rather than adding a separate hack to not touch them.

Linus
--
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/