<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/security/keys/user_defined.c, branch v3.0.86</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/security/keys/user_defined.c?h=v3.0.86</id>
<link rel='self' href='https://git.amat.us/linux/atom/security/keys/user_defined.c?h=v3.0.86'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-11-21T22:31:18Z</updated>
<entry>
<title>KEYS: Fix a NULL pointer deref in the user-defined key type</title>
<updated>2011-11-21T22:31:18Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2011-11-15T22:09:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=31a05f7dd79da9b4889008847e2a851835c14269'/>
<id>urn:sha1:31a05f7dd79da9b4889008847e2a851835c14269</id>
<content type='text'>
commit 9f35a33b8d06263a165efe3541d9aa0cdbd70b3b upstream.

Fix a NULL pointer deref in the user-defined key type whereby updating a
negative key into a fully instantiated key will cause an oops to occur
when the code attempts to free the non-existent old payload.

This results in an oops that looks something like the following:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
  IP: [&lt;ffffffff81085fa1&gt;] __call_rcu+0x11/0x13e
  PGD 3391d067 PUD 3894a067 PMD 0
  Oops: 0002 [#1] SMP
  CPU 1
  Pid: 4354, comm: keyctl Not tainted 3.1.0-fsdevel+ #1140                  /DG965RY
  RIP: 0010:[&lt;ffffffff81085fa1&gt;]  [&lt;ffffffff81085fa1&gt;] __call_rcu+0x11/0x13e
  RSP: 0018:ffff88003d591df8  EFLAGS: 00010246
  RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000000006e
  RDX: ffffffff8161d0c0 RSI: 0000000000000000 RDI: 0000000000000000
  RBP: ffff88003d591e18 R08: 0000000000000000 R09: ffffffff8152fa6c
  R10: 0000000000000000 R11: 0000000000000300 R12: ffff88003b8f9538
  R13: ffffffff8161d0c0 R14: ffff88003b8f9d50 R15: ffff88003c69f908
  FS:  00007f97eb18c720(0000) GS:ffff88003bd00000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000000000008 CR3: 000000003d47a000 CR4: 00000000000006e0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
  Process keyctl (pid: 4354, threadinfo ffff88003d590000, task ffff88003c78a040)
  Stack:
   ffff88003e0ffde0 ffff88003b8f9538 0000000000000001 ffff88003b8f9d50
   ffff88003d591e28 ffffffff810860f0 ffff88003d591e68 ffffffff8117bfea
   ffff88003d591e68 ffffffff00000000 ffff88003e0ffde1 ffff88003e0ffde0
  Call Trace:
   [&lt;ffffffff810860f0&gt;] call_rcu_sched+0x10/0x12
   [&lt;ffffffff8117bfea&gt;] user_update+0x8d/0xa2
   [&lt;ffffffff8117723a&gt;] key_create_or_update+0x236/0x270
   [&lt;ffffffff811789b1&gt;] sys_add_key+0x123/0x17e
   [&lt;ffffffff813b84bb&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Acked-by: Neil Horman &lt;nhorman@redhat.com&gt;
Acked-by: Steve Dickson &lt;steved@redhat.com&gt;
Acked-by: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Merge branch 'next' into for-linus</title>
<updated>2011-05-24T12:55:24Z</updated>
<author>
<name>James Morris</name>
<email>jmorris@namei.org</email>
</author>
<published>2011-05-24T12:55:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=434d42cfd05a7cc452457a81d2029540cba12150'/>
<id>urn:sha1:434d42cfd05a7cc452457a81d2029540cba12150</id>
<content type='text'>
</content>
</entry>
<entry>
<title>security,rcu: convert call_rcu(user_update_rcu_disposal) to kfree_rcu()</title>
<updated>2011-05-08T05:50:54Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2011-03-18T04:11:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3acb458c32293405cf68985b7b3ac5dc0a5e7929'/>
<id>urn:sha1:3acb458c32293405cf68985b7b3ac5dc0a5e7929</id>
<content type='text'>
The rcu callback user_update_rcu_disposal() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(user_update_rcu_disposal).

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
</content>
</entry>
<entry>
<title>KEYS: Improve /proc/keys</title>
<updated>2011-03-17T00:59:32Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2011-03-11T17:57:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=78b7280cce23293f7570ad52c1ffe1485c6d9669'/>
<id>urn:sha1:78b7280cce23293f7570ad52c1ffe1485c6d9669</id>
<content type='text'>
Improve /proc/keys by:

 (1) Don't attempt to summarise the payload of a negated key.  It won't have
     one.  To this end, a helper function - key_is_instantiated() has been
     added that allows the caller to find out whether the key is positively
     instantiated (as opposed to being uninstantiated or negatively
     instantiated).

 (2) Do show keys that are negative, expired or revoked rather than hiding
     them.  This requires an override flag (no_state_check) to be passed to
     search_my_process_keyrings() and keyring_search_aux() to suppress this
     check.

     Without this, keys that are possessed by the caller, but only grant
     permissions to the caller if possessed are skipped as the possession check
     fails.

     Keys that are visible due to user, group or other checks are visible with
     or without this patch.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>KEYS: Add an RCU payload dereference macro</title>
<updated>2011-03-08T00:17:11Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2011-03-07T15:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=633e804e89464d3875e59de1959a53f9041d3094'/>
<id>urn:sha1:633e804e89464d3875e59de1959a53f9041d3094</id>
<content type='text'>
Add an RCU payload dereference macro as this seems to be a common piece of code
amongst key types that use RCU referenced payloads.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@us.ibm.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>KEYS: Do some style cleanup in the key management code.</title>
<updated>2011-01-21T22:59:29Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2011-01-20T16:38:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a8b17ed019bd40d3bfa20439d9c36a99f9be9180'/>
<id>urn:sha1:a8b17ed019bd40d3bfa20439d9c36a99f9be9180</id>
<content type='text'>
Do a bit of a style clean up in the key management code.  No functional
changes.

Done using:

  perl -p -i -e 's!^/[*]*/\n!!' security/keys/*.c
  perl -p -i -e 's!} /[*] end [a-z0-9_]*[(][)] [*]/\n!}\n!' security/keys/*.c
  sed -i -s -e ": next" -e N -e 's/^\n[}]$/}/' -e t -e P -e 's/^.*\n//' -e "b next" security/keys/*.c

To remove /*****/ lines, remove comments on the closing brace of a
function to name the function and remove blank lines before the closing
brace of a function.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>KEYS: Fix an RCU warning in the reading of user keys</title>
<updated>2010-05-05T01:38:52Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-04-30T13:32:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d9a9b4aeea334e7912ce3d878d7f5cc6fdf1ffe4'/>
<id>urn:sha1:d9a9b4aeea334e7912ce3d878d7f5cc6fdf1ffe4</id>
<content type='text'>
Fix an RCU warning in the reading of user keys:

===================================================
[ INFO: suspicious rcu_dereference_check() usage. ]
---------------------------------------------------
security/keys/user_defined.c:202 invoked rcu_dereference_check() without protection!

other info that might help us debug this:

rcu_scheduler_active = 1, debug_locks = 0
1 lock held by keyctl/3637:
 #0:  (&amp;key-&gt;sem){+++++.}, at: [&lt;ffffffff811a80ae&gt;] keyctl_read_key+0x9c/0xcf

stack backtrace:
Pid: 3637, comm: keyctl Not tainted 2.6.34-rc5-cachefs #18
Call Trace:
 [&lt;ffffffff81051f6c&gt;] lockdep_rcu_dereference+0xaa/0xb2
 [&lt;ffffffff811aa55f&gt;] user_read+0x47/0x91
 [&lt;ffffffff811a80be&gt;] keyctl_read_key+0xac/0xcf
 [&lt;ffffffff811a8a06&gt;] sys_keyctl+0x75/0xb7
 [&lt;ffffffff81001eeb&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] remove many unneeded #includes of sched.h</title>
<updated>2007-02-14T16:09:54Z</updated>
<author>
<name>Tim Schmielau</name>
<email>tim@physik3.uni-rostock.de</email>
</author>
<published>2007-02-14T08:33:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cd354f1ae75e6466a7e31b727faede57a1f89ca5'/>
<id>urn:sha1:cd354f1ae75e6466a7e31b727faede57a1f89ca5</id>
<content type='text'>
After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there.  Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.

To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.

Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm.  I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).

Signed-off-by: Tim Schmielau &lt;tim@physik3.uni-rostock.de&gt;
Acked-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&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>[PATCH] keys: discard the contents of a key on revocation</title>
<updated>2006-06-26T16:58:18Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-06-26T07:24:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=31204ed925b067d2bb65adb89501656f8274a32a'/>
<id>urn:sha1:31204ed925b067d2bb65adb89501656f8274a32a</id>
<content type='text'>
Cause the keys linked to a keyring to be unlinked from it when revoked and it
causes the data attached to a user-defined key to be discarded when revoked.

This frees up most of the quota a key occupied at that point, rather than
waiting for the key to actually be destroyed.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Keys: Remove key duplication</title>
<updated>2006-01-06T16:33:29Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-01-06T08:11:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8d9067bda99c68e1a17d93e78cf3a5a3f67e0c35'/>
<id>urn:sha1:8d9067bda99c68e1a17d93e78cf3a5a3f67e0c35</id>
<content type='text'>
Remove the key duplication stuff since there's nothing that uses it, no way
to get at it and it's awkward to deal with for LSM purposes.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
