|| ||ebiederm-AT-xmission.com (Eric W. Biederman) |
|| ||Michael Stone <michael-AT-laptop.org> |
|| ||Re: Network isolation with RLIMIT_NETWORK, cont'd. |
|| ||Sun, 13 Dec 2009 02:05:19 -0800|
|| ||linux-kernel-AT-vger.kernel.org, netdev-AT-vger.kernel.org,
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>,
RÃ©mi Denis-Courmont <rdenis-AT-simphalempin.com>,
Evgeniy Polyakov <zbr-AT-ioremap.net>,
"C. Scott Ananian" <cscott-AT-cscott.net>,
James Morris <jmorris-AT-namei.org>,
Bernie Innocenti <bernie-AT-codewiz.org>,
Mark Seaborn <mrs-AT-mythic-beasts.com>,
Linux Containers <containers-AT-lists.osdl.org>|
|| ||Article, Thread
I have added the container's list to the cc as there is some overlap.
Michael Stone <firstname.lastname@example.org> writes:
> Dear lkml,
> A few months ago , I asked for feedback on a new network isolation primitive
> named "RLIMIT_NETWORK" designed for use with Unix sandboxing utilities like
> Rainbow, Plash, and friends . Thank you to all those CC'ed for your helpful
> early remarks.
> Here is an updated patchset with responses to the following criticisms:
Overall what you have looks addhoc, and very special case which is
likely to impair maintenance in the future.
Furthermore you have not addressed the primary issue that keeps
unshare(CLONE_NEWNET) requiring root privileges. You can in theory
confuse a suid root application and cause it to take action with it's
elevated privileges that violate the security policy. The network
namespace has more potential to confuse existing applications than
your mechanism, but the problem seems to remain.
> 1. ptrace()
> It was pointed out by Alan Cox, Andi Kleen, and others that processes
> which dropped their RLIMIT_NETWORK rlimit were still able to directly
> perform networking through a ptrace()'d victim.
> The new patchset adds an access check to __ptrace_may_access() to prevent
> this behavior.
Solve that with an unused uid. That ptrace_may_access check is
completely non-intuitive, and a problem if we ever remove the current
== task security module bug avoidance.
> 2. unshare(CLONE_NEWNET)
> It was pointed out by James Morris that network namespaces could be used
> to implement behavior similar to the behavior this patchset is designed to
> implement. To address this criticism, I added support for network
> namespaces to my sandboxing utility (Rainbow).
> Unfortunately, I have discovered that network namespaces in their current
> form are not appropriate for my use cases because they prevent the
> namespace'd apps from connecting to the X server, even over plain old
> AF_UNIX sockets.
We discussed that a while ago, and there is no fundamental reason to
disallow opening unix domain sockets from another network namespace.
The reason this has not been done, is that no one has taken a good
hard look at the packet transmit path and said there are no technical
problems for packets traversing between two network namespaces.
It is probably time to revisit that.
> The RLIMIT_NETWORK facility I propose contains a specific exception for
> AF_UNIX filesystem sockets since those sockets are already bound by
> regular Unix discretionary access control.
What is more significant that unix discretionary access control is the
fact that the set of available af_unix sockets you can bind to is filtered
by the mount namespace.
With respect to the problem of handling suid root applications my long
term plan is to finish the security credentials namespace aka
unshare(NEWUSER). Making the capabilities namespace local and
changing all uid based checks from uid1 == uid2 to (ns1, uid1) ==
(ns2, uid2). At which point suid root applications will not be a
problem because the problem root capabilities will not be available
for them to acquire.
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
to post comments)