summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-02-09 15:55:23 +0100
committerIngo Molnar <mingo@elte.hu>2011-02-09 15:55:23 +0100
commit8e76e081fe6b0d8e45e7d536db33b8f55de0248f (patch)
tree3ddb6dbdf5e8c18eeaba0260e557e6916edf0ddb /security
parentefca06fd74d5f41832bfbb4ba432b56b6b655d1f (diff)
parent100b33c8bd8a3235fd0b7948338d6cbb3db3c63d (diff)
Merge branch 'linus' into auto-latest
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index e276eb468536..c8d699270687 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3198,7 +3198,11 @@ static void selinux_cred_free(struct cred *cred)
{
struct task_security_struct *tsec = cred->security;
- BUG_ON((unsigned long) cred->security < PAGE_SIZE);
+ /*
+ * cred->security == NULL if security_cred_alloc_blank() or
+ * security_prepare_creds() returned an error.
+ */
+ BUG_ON(cred->security && (unsigned long) cred->security < PAGE_SIZE);
cred->security = (void *) 0x7UL;
kfree(tsec);
}