<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/security/keys, branch v3.0.62</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/security/keys?h=v3.0.62</id>
<link rel='self' href='https://git.amat.us/linux/atom/security/keys?h=v3.0.62'/>
<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>KEYS: Fix error handling in construct_key_and_link()</title>
<updated>2011-06-22T01:31:45Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2011-06-21T13:32:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b1d7dd80aadb9042e83f9778b484a2f92e0b04d4'/>
<id>urn:sha1:b1d7dd80aadb9042e83f9778b484a2f92e0b04d4</id>
<content type='text'>
Fix error handling in construct_key_and_link().

If construct_alloc_key() returns an error, it shouldn't pass out through
the normal path as the key_serial() called by the kleave() statement
will oops when it gets an error code in the pointer:

  BUG: unable to handle kernel paging request at ffffffffffffff84
  IP: [&lt;ffffffff8120b401&gt;] request_key_and_link+0x4d7/0x52f
  ..
  Call Trace:
   [&lt;ffffffff8120b52c&gt;] request_key+0x41/0x75
   [&lt;ffffffffa00ed6e8&gt;] cifs_get_spnego_key+0x206/0x226 [cifs]
   [&lt;ffffffffa00eb0c9&gt;] CIFS_SessSetup+0x511/0x1234 [cifs]
   [&lt;ffffffffa00d9799&gt;] cifs_setup_session+0x90/0x1ae [cifs]
   [&lt;ffffffffa00d9c02&gt;] cifs_get_smb_ses+0x34b/0x40f [cifs]
   [&lt;ffffffffa00d9e05&gt;] cifs_mount+0x13f/0x504 [cifs]
   [&lt;ffffffffa00caabb&gt;] cifs_do_mount+0xc4/0x672 [cifs]
   [&lt;ffffffff8113ae8c&gt;] mount_fs+0x69/0x155
   [&lt;ffffffff8114ff0e&gt;] vfs_kern_mount+0x63/0xa0
   [&lt;ffffffff81150be2&gt;] do_kern_mount+0x4d/0xdf
   [&lt;ffffffff81152278&gt;] do_mount+0x63c/0x69f
   [&lt;ffffffff8115255c&gt;] sys_mount+0x88/0xc2
   [&lt;ffffffff814fbdc2&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;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>KEYS/DNS: Fix ____call_usermodehelper() to not lose the session keyring</title>
<updated>2011-06-17T16:40:48Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2011-06-17T10:25:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=879669961b11e7f40b518784863a259f735a72bf'/>
<id>urn:sha1:879669961b11e7f40b518784863a259f735a72bf</id>
<content type='text'>
____call_usermodehelper() now erases any credentials set by the
subprocess_inf::init() function.  The problem is that commit
17f60a7da150 ("capabilites: allow the application of capability limits
to usermode helpers") creates and commits new credentials with
prepare_kernel_cred() after the call to the init() function.  This wipes
all keyrings after umh_keys_init() is called.

The best way to deal with this is to put the init() call just prior to
the commit_creds() call, and pass the cred pointer to init().  That
means that umh_keys_init() and suchlike can modify the credentials
_before_ they are published and potentially in use by the rest of the
system.

This prevents request_key() from working as it is prevented from passing
the session keyring it set up with the authorisation token to
/sbin/request-key, and so the latter can't assume the authority to
instantiate the key.  This causes the in-kernel DNS resolver to fail
with ENOKEY unconditionally.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Eric Paris &lt;eparis@redhat.com&gt;
Tested-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'docs-move' of git://git.kernel.org/pub/scm/linux/kernel/git/rdunlap/linux-docs</title>
<updated>2011-05-27T17:25:02Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-05-27T17:25:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e52e713ec30a31e9a4663d9aebbaae5ec07466a6'/>
<id>urn:sha1:e52e713ec30a31e9a4663d9aebbaae5ec07466a6</id>
<content type='text'>
* 'docs-move' of git://git.kernel.org/pub/scm/linux/kernel/git/rdunlap/linux-docs:
  Create Documentation/security/, move LSM-, credentials-, and keys-related files from Documentation/   to Documentation/security/, add Documentation/security/00-INDEX, and update all occurrences of Documentation/&lt;moved_file&gt;   to Documentation/security/&lt;moved_file&gt;.
</content>
</entry>
<entry>
<title>Set cred-&gt;user_ns in key_replace_session_keyring</title>
<updated>2011-05-26T20:49:19Z</updated>
<author>
<name>Serge E. Hallyn</name>
<email>serge@hallyn.com</email>
</author>
<published>2011-05-26T20:25:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f7285b5d631fd6096b11c6af0058ed3a2b30ef4e'/>
<id>urn:sha1:f7285b5d631fd6096b11c6af0058ed3a2b30ef4e</id>
<content type='text'>
Since this cred was not created with copy_creds(), it needs to get
initialized.  Otherwise use of syscall(__NR_keyctl, KEYCTL_SESSION_TO_PARENT);
can lead to a NULL deref.  Thanks to Robert for finding this.

But introduced by commit 47a150edc2a ("Cache user_ns in struct cred").

Signed-off-by: Serge E. Hallyn &lt;serge.hallyn@canonical.com&gt;
Reported-by: Robert Święcki &lt;robert@swiecki.net&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: stable@kernel.org (2.6.39)
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&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>Create Documentation/security/,</title>
<updated>2011-05-19T22:59:38Z</updated>
<author>
<name>Randy Dunlap</name>
<email>randy.dunlap@oracle.com</email>
</author>
<published>2011-05-19T22:59:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d410fa4ef99112386de5f218dd7df7b4fca910b4'/>
<id>urn:sha1:d410fa4ef99112386de5f218dd7df7b4fca910b4</id>
<content type='text'>
move LSM-, credentials-, and keys-related files from Documentation/
  to Documentation/security/,
add Documentation/security/00-INDEX, and
update all occurrences of Documentation/&lt;moved_file&gt;
  to Documentation/security/&lt;moved_file&gt;.
</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: Make request_key() and co. return an error for a negative key</title>
<updated>2011-03-17T00:59:49Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2011-03-11T17:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4aab1e896a0a9d57420ff2867caa5a369123d8cb'/>
<id>urn:sha1:4aab1e896a0a9d57420ff2867caa5a369123d8cb</id>
<content type='text'>
Make request_key() and co. return an error for a negative or rejected key.  If
the key was simply negated, then return ENOKEY, otherwise return the error
with which it was rejected.

Without this patch, the following command returns a key number (with the latest
keyutils):

	[root@andromeda ~]# keyctl request2 user debug:foo rejected @s
	586569904

Trying to print the key merely gets you a permission denied error:

	[root@andromeda ~]# keyctl print 586569904
	keyctl_read_alloc: Permission denied

Doing another request_key() call does get you the error, as long as it hasn't
expired yet:

	[root@andromeda ~]# keyctl request user debug:foo
	request_key: Key was rejected by service

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: 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>
</feed>
