aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
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 27b4c5527358..c3bb31ecc5aa 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1531,6 +1531,8 @@ static int inode_has_perm(const struct cred *cred,
1531 struct common_audit_data ad; 1531 struct common_audit_data ad;
1532 u32 sid; 1532 u32 sid;
1533 1533
1534 validate_creds(cred);
1535
1534 if (unlikely(IS_PRIVATE(inode))) 1536 if (unlikely(IS_PRIVATE(inode)))
1535 return 0; 1537 return 0;
1536 1538
@@ -3236,7 +3238,9 @@ static int selinux_task_create(unsigned long clone_flags)
3236static void selinux_cred_free(struct cred *cred) 3238static void selinux_cred_free(struct cred *cred)
3237{ 3239{
3238 struct task_security_struct *tsec = cred->security; 3240 struct task_security_struct *tsec = cred->security;
3239 cred->security = NULL; 3241
3242 BUG_ON((unsigned long) cred->security < PAGE_SIZE);
3243 cred->security = (void *) 0x7UL;
3240 kfree(tsec); 3244 kfree(tsec);
3241} 3245}
3242 3246