linux/security/keys
David Howells b1d7dd80aa KEYS: Fix error handling in construct_key_and_link()
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: [<ffffffff8120b401>] request_key_and_link+0x4d7/0x52f
  ..
  Call Trace:
   [<ffffffff8120b52c>] request_key+0x41/0x75
   [<ffffffffa00ed6e8>] cifs_get_spnego_key+0x206/0x226 [cifs]
   [<ffffffffa00eb0c9>] CIFS_SessSetup+0x511/0x1234 [cifs]
   [<ffffffffa00d9799>] cifs_setup_session+0x90/0x1ae [cifs]
   [<ffffffffa00d9c02>] cifs_get_smb_ses+0x34b/0x40f [cifs]
   [<ffffffffa00d9e05>] cifs_mount+0x13f/0x504 [cifs]
   [<ffffffffa00caabb>] cifs_do_mount+0xc4/0x672 [cifs]
   [<ffffffff8113ae8c>] mount_fs+0x69/0x155
   [<ffffffff8114ff0e>] vfs_kern_mount+0x63/0xa0
   [<ffffffff81150be2>] do_kern_mount+0x4d/0xdf
   [<ffffffff81152278>] do_mount+0x63c/0x69f
   [<ffffffff8115255c>] sys_mount+0x88/0xc2
   [<ffffffff814fbdc2>] system_call_fastpath+0x16/0x1b

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-21 18:31:45 -07:00
..
compat.c KEYS: Add an iovec version of KEYCTL_INSTANTIATE 2011-03-08 11:17:22 +11:00
encrypted.c Create Documentation/security/, 2011-05-19 15:59:38 -07:00
encrypted.h encrypted-keys: rename encrypted_defined files to encrypted 2011-01-24 10:27:57 +11:00
gc.c KEYS: Fix up comments in key management code 2011-01-21 14:59:30 -08:00
internal.h KEYS: Improve /proc/keys 2011-03-17 11:59:32 +11:00
key.c KEYS: Add a new keyctl op to reject a key with a specified error code 2011-03-08 11:17:18 +11:00
keyctl.c KEYS: Make request_key() and co. return an error for a negative key 2011-03-17 11:59:49 +11:00
keyring.c KEYS: Improve /proc/keys 2011-03-17 11:59:32 +11:00
Makefile encrypted-keys: rename encrypted_defined files to encrypted 2011-01-24 10:27:57 +11:00
permission.c KEYS: Fix up comments in key management code 2011-01-21 14:59:30 -08:00
proc.c KEYS: Improve /proc/keys 2011-03-17 11:59:32 +11:00
process_keys.c Set cred->user_ns in key_replace_session_keyring 2011-05-26 13:49:19 -07:00
request_key.c KEYS: Fix error handling in construct_key_and_link() 2011-06-21 18:31:45 -07:00
request_key_auth.c Merge branch 'docs-move' of git://git.kernel.org/pub/scm/linux/kernel/git/rdunlap/linux-docs 2011-05-27 10:25:02 -07:00
sysctl.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
trusted.c Create Documentation/security/, 2011-05-19 15:59:38 -07:00
trusted.h trusted-keys: rename trusted_defined files to trusted 2011-01-24 10:14:22 +11:00
user_defined.c Merge branch 'next' into for-linus 2011-05-24 22:55:24 +10:00