From: Michael Stone <michael@laptop.org>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org,
"Andi Kleen" <andi@firstfloor.org>, "David Lang" <david@lang.hm>,
"Oliver Hartkopp" <socketcan@hartkopp.net>,
"Alan Cox" <alan@lxorguk.ukuu.org.uk>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
"Valdis Kletnieks" <Valdis.Kletnieks@vt.edu>,
"Bryan Donlan" <bdonlan@gmail.com>,
"Evgeniy Polyakov" <zbr@ioremap.net>,
"C. Scott Ananian" <cscott@cscott.net>,
"James Morris" <jmorris@namei.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
"Bernie Innocenti" <bernie@codewiz.org>,
"Mark Seaborn" <mrs@mythic-beasts.com>,
"Randy Dunlap" <randy.dunlap@oracle.com>,
"Américo Wang" <xiyou.wangcong@gmail.com>,
"Tetsuo Handa" <penguin-kernel@i-love.sakura.ne.jp>,
"Samir Bellabes" <sam@synack.fr>,
"Casey Schaufler" <casey@schaufler-ca.com>,
"Pavel Machek" <pavel@ucw.cz>,
"Michael Stone" <michael@laptop.org>
Subject: Re: A basic question about the security_* hooks
Date: Sat, 26 Dec 2009 14:50:44 -0500 [thread overview]
Message-ID: <20091226195043.GA1945@heat> (raw)
In-Reply-To: <20091225055034.GA374@us.ibm.com>
> Well, taking a step back - what exactly is the motivation for making this
> an LSM? Is it just to re-use the callsites?
Yes. Alan Cox, referencing earlier versions of my patches, wrote:
"This is a security model, it belongs as a security model using LSM."
> I ask bc the API is in the prctl code, so the LSM
> is conceptually always there, which is different from other LSMs.
The goal is to provide a stupidly simple unprivileged per-process network
isolation primitive which is broadly available "without jumping through hoops".
(See http://cr.yp.to/unix/disablenetwork.html for a nice writeup.)
I need a primitive like this to further my work on the OLPC Bitfrost security
architecture and to further my more general work on advancing the state of
sandboxing technology. (See sandboxing.org.)
I'm willing to entertain pretty much any implementation or interface request
which meets that goal and which implements the desired semantics.
>>>> 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.
>>
>> Have you any specific examples of problems that have been clearly averted
>> by the current arrangement?
>
> If you look back over the archives of when I was pushing the LSM stacker
> around 2005, there were several cases where just stacking capability and
> selinux were problematic.
Thank you for the pointers to your earlier work and for the work itself. We
probably wouldn't be having this conversation if your work had been merged.
Unfortunately, that happy event did not come to pass.
Thus, returning to today: the most serious objection that I've heard so far
about LSM stacking is that making it too "automatic" is likely to result in
preventable security faults.
For this argument to be valid, there *must* also be a second clause which
states that the cost of the unknown security faults prevented by making
stacking hard exceeds the cost of the known security faults which would be
prevented by the additional security primitives that stacking, in any usable
form, would permit. Otherwise, the sustaining the objection leads to a worse
outcome.
Now, given this argument, what do you actually think about systems that, like
your work, enable stacking but which do so "less automatically", e.g. by
hand-writing the implementations of the security_*() hooks like so:
int security_socket_create(int family, int type, int protocol, int kern)
{
int ret = 0;
#ifdef CONFIG_SECURITY_SELINUX
ret = selinux_security_socket_create(family, type, protocol, kern);
if(ret)
goto out;
#endif
#ifdef CONFIG_SECURITY_TOMOYO
ret = tomoyo_security_socket_create(family, type, protocol, kern);
if(ret)
goto out;
#endif
#ifdef CONFIG_SECURITY_SMACK
ret = smack_security_socket_create(family, type, protocol, kern);
if(ret)
goto out;
#endif
#ifdef CONFIG_SECURITY_PRCTL_NETWORK
ret = prctl_network_socket_create(family, type, protocol, kern);
if(ret)
goto out;
#endif
out:
return ret;
}
This way, the behavior of the system is as predictable as possible, we can
statically check for known unsafe configurations, manual tweaking of the order
in which functionality is composed is possible, and security is fully
"pay-as-you-go".
Where is the flaw in this approach?
Regards,
Michael
P.S. - I think I will write up some new patches for prctl_network based on this
idea so that we can see what they look like.
next prev parent reply other threads:[~2009-12-26 19:48 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-24 2:29 A basic question about the security_* hooks Michael Stone
2009-12-24 4:50 ` Casey Schaufler
2009-12-24 12:53 ` Eric W. Biederman
2009-12-24 21:55 ` Tetsuo Handa
2009-12-25 0:05 ` Serge E. Hallyn
2009-12-31 17:50 ` David P. Quigley
2010-01-04 2:12 ` Paul Moore
2009-12-24 7:36 ` Evgeniy Polyakov
2009-12-24 18:57 ` Samir Bellabes
2009-12-25 0:14 ` Serge E. Hallyn
2009-12-25 1:11 ` Michael Stone
2009-12-25 5:50 ` Serge E. Hallyn
2009-12-26 19:50 ` Michael Stone [this message]
2009-12-27 3:16 ` Serge E. Hallyn
2009-12-27 4:02 ` Tetsuo Handa
2009-12-27 10:56 ` Valdis.Kletnieks
2009-12-27 14:54 ` Serge E. Hallyn
2009-12-27 20:28 ` David Wagner
2009-12-28 2:08 ` Valdis.Kletnieks
2009-12-28 11:51 ` Tetsuo Handa
2009-12-28 14:45 ` Valdis.Kletnieks
2009-12-28 14:51 ` Valdis.Kletnieks
2009-12-29 13:01 ` Label based MAC + Name based MAC (was Re: A basic question about the security_* hooks) Tetsuo Handa
2010-01-02 13:56 ` A basic question about the security_* hooks Pavel Machek
2009-12-28 15:24 ` Kyle Moffett
2009-12-29 1:43 ` Casey Schaufler
2009-12-29 19:02 ` Kyle Moffett
2009-12-30 19:49 ` Casey Schaufler
2009-12-27 0:33 ` Mimi Zohar
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=20091226195043.GA1945@heat \
--to=michael@laptop.org \
--cc=Valdis.Kletnieks@vt.edu \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andi@firstfloor.org \
--cc=bdonlan@gmail.com \
--cc=bernie@codewiz.org \
--cc=casey@schaufler-ca.com \
--cc=cscott@cscott.net \
--cc=david@lang.hm \
--cc=ebiederm@xmission.com \
--cc=herbert@gondor.apana.org.au \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mrs@mythic-beasts.com \
--cc=pavel@ucw.cz \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=randy.dunlap@oracle.com \
--cc=sam@synack.fr \
--cc=serue@us.ibm.com \
--cc=socketcan@hartkopp.net \
--cc=xiyou.wangcong@gmail.com \
--cc=zbr@ioremap.net \
/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