linux/security/keys
Takashi Iwai 26090b176d KEYS: Fix stale key registration at error path
commit b26bdde5bb upstream.

When loading encrypted-keys module, if the last check of
aes_get_sizes() in init_encrypted() fails, the driver just returns an
error without unregistering its key type.  This results in the stale
entry in the list.  In addition to memory leaks, this leads to a kernel
crash when registering a new key type later.

This patch fixes the problem by swapping the calls of aes_get_sizes()
and register_key_type(), and releasing resources properly at the error
paths.

Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=908163
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-08 10:00:49 -08:00
..
encrypted-keys
big_key.c
compat.c
gc.c
internal.h
Kconfig
key.c
keyctl.c
keyring.c
Makefile
permission.c
persistent.c
proc.c
process_keys.c
request_key_auth.c
request_key.c
sysctl.c
trusted.c
trusted.h
user_defined.c