diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-20 19:38:15 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 01:43:26 -0400 |
commit | e74f71eb78a4a8b9eaf1bc65f20f761648e85f76 (patch) | |
tree | 7bc7fc1344f5ed6e3ce8132b36125ef5cec6407c /security/smack | |
parent | 10556cb21a0d0b24d95f00ea6df16f599a3345b2 (diff) |
->permission() sanitizing: don't pass flags to ->inode_permission()
pass that via mask instead.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/smack')
-rw-r--r-- | security/smack/smack_lsm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 9831a39c11f6..f375eb2e1957 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -689,9 +689,10 @@ static int smack_inode_rename(struct inode *old_inode, | |||
689 | * | 689 | * |
690 | * Returns 0 if access is permitted, -EACCES otherwise | 690 | * Returns 0 if access is permitted, -EACCES otherwise |
691 | */ | 691 | */ |
692 | static int smack_inode_permission(struct inode *inode, int mask, unsigned flags) | 692 | static int smack_inode_permission(struct inode *inode, int mask) |
693 | { | 693 | { |
694 | struct smk_audit_info ad; | 694 | struct smk_audit_info ad; |
695 | int no_block = mask & MAY_NOT_BLOCK; | ||
695 | 696 | ||
696 | mask &= (MAY_READ|MAY_WRITE|MAY_EXEC|MAY_APPEND); | 697 | mask &= (MAY_READ|MAY_WRITE|MAY_EXEC|MAY_APPEND); |
697 | /* | 698 | /* |
@@ -701,7 +702,7 @@ static int smack_inode_permission(struct inode *inode, int mask, unsigned flags) | |||
701 | return 0; | 702 | return 0; |
702 | 703 | ||
703 | /* May be droppable after audit */ | 704 | /* May be droppable after audit */ |
704 | if (flags & IPERM_FLAG_RCU) | 705 | if (no_block) |
705 | return -ECHILD; | 706 | return -ECHILD; |
706 | smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_INODE); | 707 | smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_INODE); |
707 | smk_ad_setfield_u_fs_inode(&ad, inode); | 708 | smk_ad_setfield_u_fs_inode(&ad, inode); |