• David Howells's avatar
    keys: Handle there being no fallback destination keyring for request_key() · 34574dd1
    David Howells authored
    When request_key() is called, without there being any standard process
    keyrings on which to fall back if a destination keyring is not specified, an
    oops is liable to occur when construct_alloc_key() calls down_write() on
    dest_keyring's semaphore.
    
    Due to function inlining this may be seen as an oops in down_write() as called
    from request_key_and_link().
    
    This situation crops up during boot, where request_key() is called from within
    the kernel (such as in CIFS mounts) where nobody is actually logged in, and so
    PAM has not had a chance to create a session keyring and user keyrings to act
    as the fallback.
    
    To fix this, make construct_alloc_key() not attempt to cache a key if there is
    no fallback key if no destination keyring is given specifically.
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Tested-by: default avatarJeff Layton <jlayton@redhat.com>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    34574dd1
Name
Last commit
Last update
..
integrity/ima Loading commit data...
keys Loading commit data...
selinux Loading commit data...
smack Loading commit data...
tomoyo Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
capability.c Loading commit data...
commoncap.c Loading commit data...
device_cgroup.c Loading commit data...
inode.c Loading commit data...
root_plug.c Loading commit data...
security.c Loading commit data...