<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/capability.c, branch v3.0.50</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.50</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.50'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2011-05-19T08:51:57Z</updated>
<entry>
<title>Merge branch 'master' into next</title>
<updated>2011-05-19T08:51:57Z</updated>
<author>
<name>James Morris</name>
<email>jmorris@namei.org</email>
</author>
<published>2011-05-19T08:51:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=12a5a2621b1ee14d32beca35304d7c6076a58815'/>
<id>urn:sha1:12a5a2621b1ee14d32beca35304d7c6076a58815</id>
<content type='text'>
Conflicts:
	include/linux/capability.h

Manually resolve merge conflict w/ thanks to Stephen Rothwell.

Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>Cache user_ns in struct cred</title>
<updated>2011-05-13T18:45:33Z</updated>
<author>
<name>Serge E. Hallyn</name>
<email>serge.hallyn@canonical.com</email>
</author>
<published>2011-05-13T03:27:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=47a150edc2ae734c0f4bf50aa19499e23b9a46f8'/>
<id>urn:sha1:47a150edc2ae734c0f4bf50aa19499e23b9a46f8</id>
<content type='text'>
If !CONFIG_USERNS, have current_user_ns() defined to (&amp;init_user_ns).

Get rid of _current_user_ns.  This requires nsown_capable() to be
defined in capability.c rather than as static inline in capability.h,
so do that.

Request_key needs init_user_ns defined at current_user_ns if
!CONFIG_USERNS, so forward-declare that in cred.h if !CONFIG_USERNS
at current_user_ns() define.

Compile-tested with and without CONFIG_USERNS.

Signed-off-by: Serge E. Hallyn &lt;serge.hallyn@canonical.com&gt;
[ This makes a huge performance difference for acl_permission_check(),
  up to 30%.  And that is one of the hottest kernel functions for loads
  that are pathname-lookup heavy.  ]
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>capabilities: delete unused cap_set_full</title>
<updated>2011-04-04T00:31:12Z</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2011-04-01T21:08:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5163b583a036b103c3cec7171d6731c125773ed6'/>
<id>urn:sha1:5163b583a036b103c3cec7171d6731c125773ed6</id>
<content type='text'>
unused code.  Clean it up.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Andrew G. Morgan &lt;morgan@kernel.org&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>capabilities: do not drop CAP_SETPCAP from the initial task</title>
<updated>2011-04-04T00:31:09Z</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2011-04-01T21:08:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ffa8e59df047d57e812a04f7d6baf6a25c652c0c'/>
<id>urn:sha1:ffa8e59df047d57e812a04f7d6baf6a25c652c0c</id>
<content type='text'>
In olden' days of yore CAP_SETPCAP had special meaning for the init task.
We actually have code to make sure that CAP_SETPCAP wasn't in pE of things
using the init_cred.  But CAP_SETPCAP isn't so special any more and we
don't have a reason to special case dropping it for init or kthreads....

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Acked-by: Andrew G. Morgan &lt;morgan@kernel.org&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>userns: make has_capability* into real functions</title>
<updated>2011-03-24T02:47:06Z</updated>
<author>
<name>Serge E. Hallyn</name>
<email>serge.hallyn@canonical.com</email>
</author>
<published>2011-03-23T23:43:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3263245de48344ad7bdd0e7256bf1606d2592f88'/>
<id>urn:sha1:3263245de48344ad7bdd0e7256bf1606d2592f88</id>
<content type='text'>
So we can let type safety keep things sane, and as a bonus we can remove
the declaration of init_user_ns in capability.h.

Signed-off-by: Serge E. Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Daniel Lezcano &lt;daniel.lezcano@free.fr&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>userns: security: make capabilities relative to the user namespace</title>
<updated>2011-03-24T02:47:02Z</updated>
<author>
<name>Serge E. Hallyn</name>
<email>serge@hallyn.com</email>
</author>
<published>2011-03-23T23:43:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3486740a4f32a6a466f5ac931654d154790ba648'/>
<id>urn:sha1:3486740a4f32a6a466f5ac931654d154790ba648</id>
<content type='text'>
- Introduce ns_capable to test for a capability in a non-default
  user namespace.
- Teach cap_capable to handle capabilities in a non-default
  user namespace.

The motivation is to get to the unprivileged creation of new
namespaces.  It looks like this gets us 90% of the way there, with
only potential uid confusion issues left.

I still need to handle getting all caps after creation but otherwise I
think I have a good starter patch that achieves all of your goals.

Changelog:
	11/05/2010: [serge] add apparmor
	12/14/2010: [serge] fix capabilities to created user namespaces
	Without this, if user serge creates a user_ns, he won't have
	capabilities to the user_ns he created.  THis is because we
	were first checking whether his effective caps had the caps
	he needed and returning -EPERM if not, and THEN checking whether
	he was the creator.  Reverse those checks.
	12/16/2010: [serge] security_real_capable needs ns argument in !security case
	01/11/2011: [serge] add task_ns_capable helper
	01/11/2011: [serge] add nsown_capable() helper per Bastian Blank suggestion
	02/16/2011: [serge] fix a logic bug: the root user is always creator of
		    init_user_ns, but should not always have capabilities to
		    it!  Fix the check in cap_capable().
	02/21/2011: Add the required user_ns parameter to security_capable,
		    fixing a compile failure.
	02/23/2011: Convert some macros to functions as per akpm comments.  Some
		    couldn't be converted because we can't easily forward-declare
		    them (they are inline if !SECURITY, extern if SECURITY).  Add
		    a current_user_ns function so we can use it in capability.h
		    without #including cred.h.  Move all forward declarations
		    together to the top of the #ifdef __KERNEL__ section, and use
		    kernel-doc format.
	02/23/2011: Per dhowells, clean up comment in cap_capable().
	02/23/2011: Per akpm, remove unreachable 'return -EPERM' in cap_capable.

(Original written and signed off by Eric;  latest, modified version
acked by him)

[akpm@linux-foundation.org: fix build]
[akpm@linux-foundation.org: export current_user_ns() for ecryptfs]
[serge.hallyn@canonical.com: remove unneeded extra argument in selinux's task_has_capability]
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Serge E. Hallyn &lt;serge.hallyn@canonical.com&gt;
Acked-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@free.fr&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: Serge E. Hallyn &lt;serge.hallyn@canonical.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>security: add cred argument to security_capable()</title>
<updated>2011-02-11T06:41:58Z</updated>
<author>
<name>Chris Wright</name>
<email>chrisw@sous-sol.org</email>
</author>
<published>2011-02-10T06:11:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6037b715d6fab139742c3df8851db4c823081561'/>
<id>urn:sha1:6037b715d6fab139742c3df8851db4c823081561</id>
<content type='text'>
Expand security_capable() to include cred, so that it can be usable in a
wider range of call sites.

Signed-off-by: Chris Wright &lt;chrisw@sous-sol.org&gt;
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>sched: Remove remaining USER_SCHED code</title>
<updated>2010-04-02T18:12:00Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2010-03-24T05:17:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=32bd7eb5a7f4596c8440dd9440322fe9e686634d'/>
<id>urn:sha1:32bd7eb5a7f4596c8440dd9440322fe9e686634d</id>
<content type='text'>
This is left over from commit 7c9414385e ("sched: Remove USER_SCHED"")

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Dhaval Giani &lt;dhaval.giani@gmail.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
LKML-Reference: &lt;4BA9A05F.7010407@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>capabilities: Use RCU to protect task lookup in sys_capget</title>
<updated>2009-12-09T22:42:48Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-12-09T16:13:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=86fc80f16e8a2449d5827bf1a9838b7fd9f70097'/>
<id>urn:sha1:86fc80f16e8a2449d5827bf1a9838b7fd9f70097</id>
<content type='text'>
cap_get_target_pid() protects the task lookup with tasklist_lock.
security_capget() is called under tasklist_lock as well but
tasklist_lock does not protect anything there. The capabilities are
protected by RCU already.

So tasklist_lock only protects the lookup and prevents the task going
away, which can be done with rcu_read_lock() as well.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>remove CONFIG_SECURITY_FILE_CAPABILITIES compile option</title>
<updated>2009-11-24T04:06:47Z</updated>
<author>
<name>Serge E. Hallyn</name>
<email>serue@us.ibm.com</email>
</author>
<published>2009-11-23T22:21:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b3a222e52e4d4be77cc4520a57af1a4a0d8222d1'/>
<id>urn:sha1:b3a222e52e4d4be77cc4520a57af1a4a0d8222d1</id>
<content type='text'>
As far as I know, all distros currently ship kernels with default
CONFIG_SECURITY_FILE_CAPABILITIES=y.  Since having the option on
leaves a 'no_file_caps' option to boot without file capabilities,
the main reason to keep the option is that turning it off saves
you (on my s390x partition) 5k.  In particular, vmlinux sizes
came to:

without patch fscaps=n:		 	53598392
without patch fscaps=y:		 	53603406
with this patch applied:		53603342

with the security-next tree.

Against this we must weigh the fact that there is no simple way for
userspace to figure out whether file capabilities are supported,
while things like per-process securebits, capability bounding
sets, and adding bits to pI if CAP_SETPCAP is in pE are not supported
with SECURITY_FILE_CAPABILITIES=n, leaving a bit of a problem for
applications wanting to know whether they can use them and/or why
something failed.

It also adds another subtly different set of semantics which we must
maintain at the risk of severe security regressions.

So this patch removes the SECURITY_FILE_CAPABILITIES compile
option.  It drops the kernel size by about 50k over the stock
SECURITY_FILE_CAPABILITIES=y kernel, by removing the
cap_limit_ptraced_target() function.

Changelog:
	Nov 20: remove cap_limit_ptraced_target() as it's logic
		was ifndef'ed.

Signed-off-by: Serge E. Hallyn &lt;serue@us.ibm.com&gt;
Acked-by: Andrew G. Morgan" &lt;morgan@kernel.org&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
</feed>
