android_kernel_samsung_msm8976/security
Takashi Iwai 18b41bd86e KEYS: Fix stale key registration at error path
commit b26bdde5bb27f3f900e25a95e33a0c476c8c2c48 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 09:58:16 -08:00
..
apparmor new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
integrity evm: check xattr value length and type in evm_inode_setxattr() 2014-11-14 08:47:54 -08:00
keys KEYS: Fix stale key registration at error path 2015-01-08 09:58:16 -08:00
selinux selinux: fix inode security list corruption 2014-11-14 08:47:55 -08:00
smack Smack: include magic.h in smackfs.c 2013-04-03 13:13:51 +11:00
tomoyo Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-01 17:51:54 -07:00
yama yama: Better permission check for ptraceme 2013-03-26 13:17:58 -07:00
Kconfig KEYS: Move the key config into security/keys/Kconfig 2012-05-11 10:56:56 +01:00
Makefile
capability.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2013-04-30 16:27:51 -07:00
commoncap.c CAPABILITIES: remove undefined caps from all processes 2014-09-17 09:03:57 -07:00
device_cgroup.c devcg: remove parent_cgroup. 2013-04-18 11:34:35 -07:00
inode.c
lsm_audit.c LSM: BUILD_BUG_ON if the common_audit_data union ever grows 2012-04-09 12:23:03 -04:00
min_addr.c
security.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2013-04-30 16:27:51 -07:00