aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
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)
3198{ 3198{
3199 struct task_security_struct *tsec = cred->security; 3199 struct task_security_struct *tsec = cred->security;
3200 3200
3201 BUG_ON((unsigned long) cred->security < PAGE_SIZE); 3201 /*
3202 * cred->security == NULL if security_cred_alloc_blank() or
3203 * security_prepare_creds() returned an error.
3204 */
3205 BUG_ON(cred->security && (unsigned long) cred->security < PAGE_SIZE);
3202 cred->security = (void *) 0x7UL; 3206 cred->security = (void *) 0x7UL;
3203 kfree(tsec); 3207 kfree(tsec);
3204} 3208}