linux/security/keys
Takashi Iwai b26bdde5bb KEYS: Fix stale key registration at error path
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
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
2014-12-06 21:50:36 -05:00
..
encrypted-keys KEYS: Fix stale key registration at error path 2014-12-06 21:50:36 -05:00
big_key.c KEYS: Remove key_type::match in favour of overriding default by match_preparse 2014-09-16 17:36:06 +01:00
compat.c security/compat: convert to COMPAT_SYSCALL_DEFINE 2014-03-06 16:30:42 +01:00
gc.c sched: Remove proliferation of wait_on_bit() action functions 2014-07-16 15:10:39 +02:00
internal.h KEYS: Make the key matching functions return bool 2014-09-16 17:36:08 +01:00
Kconfig KEYS: Make BIG_KEYS boolean 2013-10-30 11:15:23 +00:00
key.c Merge commit 'v3.17' into next 2014-11-19 21:32:12 +11:00
keyctl.c KEYS: Reinstate EPERM for a key type name beginning with a '.' 2014-09-16 17:29:03 +01:00
keyring.c KEYS: Make the key matching functions return bool 2014-09-16 17:36:08 +01:00
Makefile KEYS: Add per-user_namespace registers for persistent per-UID kerberos caches 2013-09-24 10:35:19 +01:00
permission.c KEYS: Move the flags representing required permission to linux/key.h 2014-03-14 17:44:49 +00:00
persistent.c KEYS: Move the flags representing required permission to linux/key.h 2014-03-14 17:44:49 +00:00
proc.c KEYS: Preparse match data 2014-09-16 17:36:02 +01:00
process_keys.c KEYS: Make the key matching functions return bool 2014-09-16 17:36:08 +01:00
request_key.c Merge commit 'v3.17' into next 2014-11-19 21:32:12 +11:00
request_key_auth.c KEYS: Remove key_type::match in favour of overriding default by match_preparse 2014-09-16 17:36:06 +01:00
sysctl.c security: Convert use of typedef ctl_table to struct ctl_table 2014-04-15 13:39:58 +10:00
trusted.c KEYS: Remove key_type::match in favour of overriding default by match_preparse 2014-09-16 17:36:06 +01:00
trusted.h
user_defined.c KEYS: Remove key_type::match in favour of overriding default by match_preparse 2014-09-16 17:36:06 +01:00