kernel_optimize_test/security
Tetsuo Handa 2edeaa34a6 CRED: Fix BUG() upon security_cred_alloc_blank() failure
In cred_alloc_blank() since 2.6.32, abort_creds(new) is called with
new->security == NULL and new->magic == 0 when security_cred_alloc_blank()
returns an error.  As a result, BUG() will be triggered if SELinux is enabled
or CONFIG_DEBUG_CREDENTIALS=y.

If CONFIG_DEBUG_CREDENTIALS=y, BUG() is called from __invalid_creds() because
cred->magic == 0.  Failing that, BUG() is called from selinux_cred_free()
because selinux_cred_free() is not expecting cred->security == NULL.  This does
not affect smack_cred_free(), tomoyo_cred_free() or apparmor_cred_free().

Fix these bugs by

(1) Set new->magic before calling security_cred_alloc_blank().

(2) Handle null cred->security in creds_are_invalid() and selinux_cred_free().

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-02-07 14:04:00 -08:00
..
apparmor Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-01-13 10:05:56 -08:00
integrity/ima ima: fix add LSM rule bug 2011-01-03 16:36:33 -08:00
keys KEYS: Fix __key_link_end() quota fixup on error 2011-01-26 08:58:20 +10:00
selinux CRED: Fix BUG() upon security_cred_alloc_blank() failure 2011-02-07 14:04:00 -08:00
smack Merge branch 'master' into next 2011-01-10 09:46:24 +11:00
tomoyo fs: dcache scale d_unhashed 2011-01-07 17:50:21 +11:00
capability.c af_unix: Avoid socket->sk NULL OOPS in stream connect security hooks. 2011-01-05 15:38:53 -08:00
commoncap.c
device_cgroup.c
inode.c
Kconfig keys: add new key-type encrypted 2010-11-29 08:55:29 +11:00
lsm_audit.c
Makefile
min_addr.c
security.c Merge branch 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin 2011-01-07 08:56:33 -08:00