|| ||"Serge E. Hallyn" <serue-AT-us.ibm.com> |
|| ||Michael Stone <michael-AT-laptop.org> |
|| ||Re: A basic question about the security_* hooks |
|| ||Thu, 24 Dec 2009 18:14:22 -0600|
Andi Kleen <andi-AT-firstfloor.org>, David Lang <david-AT-lang.hm>,
Oliver Hartkopp <socketcan-AT-hartkopp.net>,
Alan Cox <alan-AT-lxorguk.ukuu.org.uk>,
Herbert Xu <herbert-AT-gondor.apana.org.au>,
Valdis Kletnieks <Valdis.Kletnieks-AT-vt.edu>,
Bryan Donlan <bdonlan-AT-gmail.com>,
Evgeniy Polyakov <zbr-AT-ioremap.net>,
"C. Scott Ananian" <cscott-AT-cscott.net>,
James Morris <jmorris-AT-namei.org>,
"Eric W. Biederman" <ebiederm-AT-xmission.com>,
Bernie Innocenti <bernie-AT-codewiz.org>,
Mark Seaborn <mrs-AT-mythic-beasts.com>,
Randy Dunlap <randy.dunlap-AT-oracle.com>,
AmÃ©rico Wang <xiyou.wangcong-AT-gmail.com>|
|| ||Article, Thread
Quoting Michael Stone (email@example.com):
> Dear kernel folks,
> There are a variety of places where I'd like to be able to get the kernel to
> return EPERM more often . Many of these places already have security hooks.
> Unfortunately, I don't feel that I can make effective use of these hooks
> because they seem to be "occupied" by the large mandatory access control
> I'm hoping that you can tell me why this state of affairs persists.
> More specifically, now that LSMs are statically linked, why is it good for the
> security hooks to call into a single monolithic "security_ops" struct instead
> of cheaper and simpler alternatives?
> In particular, what would be worse about a kernel in which each security hook
> contained nothing but conditionally-compiled function calls to the appropriate
> "real" implementation functions with early-exit jumps on non-zero return codes?
The problem is that composing any two security policies can quickly have
subtle, unforeseen, but dangerous effects. That's why so far we have
stuck with the status quo where only one LSM is 'active', but that LSM
can manually call hooks from other LSMs.
So with your module, I'd recommend following the route of the capabilities
LSM. You can provide an optional stand-alone LSM which only hooks your
functions. Then smack, for instance, can call the functions in your LSM
from within its own hooks, or it can simply explicitly assign its hooks to
your functions in smack_ops. Selinux can do the same thing, although I
suspect they would more likely implement their own functions for your newly
A distro can then compile a kernel with all LSMs compiled in, and switch
behavior by using "security=selinux" vs. "security=prctl_network_lsm"
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to firstname.lastname@example.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
to post comments)