aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/namei.c3
-rw-r--r--security/selinux/hooks.c2
-rw-r--r--security/smack/smack_lsm.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index fe34c2b879f4..42d2d28fb827 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -282,8 +282,7 @@ int inode_permission(struct inode *inode, int mask)
282 if (retval) 282 if (retval)
283 return retval; 283 return retval;
284 284
285 return security_inode_permission(inode, 285 return security_inode_permission(inode, mask);
286 mask & (MAY_READ|MAY_WRITE|MAY_EXEC|MAY_APPEND));
287} 286}
288 287
289/** 288/**
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 85338f0c0481..0c98846f188d 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2645,6 +2645,8 @@ static int selinux_inode_permission(struct inode *inode, int mask)
2645{ 2645{
2646 const struct cred *cred = current_cred(); 2646 const struct cred *cred = current_cred();
2647 2647
2648 mask &= (MAY_READ|MAY_WRITE|MAY_EXEC|MAY_APPEND);
2649
2648 if (!mask) { 2650 if (!mask) {
2649 /* No permission to check. Existence test. */ 2651 /* No permission to check. Existence test. */
2650 return 0; 2652 return 0;
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 07abc9ce72f2..9192ba366a4c 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -598,6 +598,8 @@ static int smack_inode_rename(struct inode *old_inode,
598static int smack_inode_permission(struct inode *inode, int mask) 598static int smack_inode_permission(struct inode *inode, int mask)
599{ 599{
600 struct smk_audit_info ad; 600 struct smk_audit_info ad;
601
602 mask &= (MAY_READ|MAY_WRITE|MAY_EXEC|MAY_APPEND);
601 /* 603 /*
602 * No permission to check. Existence test. Yup, it's there. 604 * No permission to check. Existence test. Yup, it's there.
603 */ 605 */