diff options
| author | James Morris <jmorris@namei.org> | 2011-03-08 10:55:06 +1100 |
|---|---|---|
| committer | James Morris <jmorris@namei.org> | 2011-03-08 10:55:06 +1100 |
| commit | 1cc26bada9f6807814806db2f0d78792eecdac71 (patch) | |
| tree | 5509b5139db04af6c13db0a580c84116a4a54039 /security/selinux/hooks.c | |
| parent | eae61f3c829439f8f9121b5cd48a14be04df451f (diff) | |
| parent | 214d93b02c4fe93638ad268613c9702a81ed9192 (diff) | |
| download | olio-linux-3.10-1cc26bada9f6807814806db2f0d78792eecdac71.tar.xz olio-linux-3.10-1cc26bada9f6807814806db2f0d78792eecdac71.zip | |
Merge branch 'master'; commit 'v2.6.38-rc7' into next
Diffstat (limited to 'security/selinux/hooks.c')
| -rw-r--r-- | security/selinux/hooks.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index e276eb46853..c8d69927068 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); } |