summaryrefslogtreecommitdiff
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-02-16 13:31:51 +0100
committerIngo Molnar <mingo@elte.hu>2011-02-16 13:31:55 +0100
commit48fa4b8ecf683f5e411303553da9e186e8b8406e (patch)
tree76cec4aa8cca18a44b1bd6e5be68c462a0e66d5f /security/selinux/hooks.c
parentd95f412200652694e63e64bfd49f0ae274a54479 (diff)
parent85e2efbb1db9a18d218006706d6e4fbeb0216213 (diff)
Merge commit 'v2.6.38-rc5' into sched/core
Merge reason: Pick up upstream fixes. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'security/selinux/hooks.c')
-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);
}