diff options
author | Andi Kleen <ak@linux.intel.com> | 2011-04-21 20:23:19 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2011-04-25 10:20:32 -0400 |
commit | 1c9904297451f558191e211a48d8838b4bf792b0 (patch) | |
tree | 9c7cabec6ce3d6604147de73953cfaca672f1c0d /security/smack | |
parent | 6b697323a78bed254ee372f71b1a6a2901bb4b7a (diff) |
SECURITY: Move exec_permission RCU checks into security modules
Right now all RCU walks fall back to reference walk when CONFIG_SECURITY
is enabled, even though just the standard capability module is active.
This is because security_inode_exec_permission unconditionally fails
RCU walks.
Move this decision to the low level security module. This requires
passing the RCU flags down the security hook. This way at least
the capability module and a few easy cases in selinux/smack work
with RCU walks with CONFIG_SECURITY=y
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'security/smack')
-rw-r--r-- | security/smack/smack_lsm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 23c7a6d0c80c..42fcb47747a3 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -686,7 +686,7 @@ static int smack_inode_rename(struct inode *old_inode, | |||
686 | * | 686 | * |
687 | * Returns 0 if access is permitted, -EACCES otherwise | 687 | * Returns 0 if access is permitted, -EACCES otherwise |
688 | */ | 688 | */ |
689 | static int smack_inode_permission(struct inode *inode, int mask) | 689 | static int smack_inode_permission(struct inode *inode, int mask, unsigned flags) |
690 | { | 690 | { |
691 | struct smk_audit_info ad; | 691 | struct smk_audit_info ad; |
692 | 692 | ||
@@ -696,6 +696,10 @@ static int smack_inode_permission(struct inode *inode, int mask) | |||
696 | */ | 696 | */ |
697 | if (mask == 0) | 697 | if (mask == 0) |
698 | return 0; | 698 | return 0; |
699 | |||
700 | /* May be droppable after audit */ | ||
701 | if (flags & IPERM_FLAG_RCU) | ||
702 | return -ECHILD; | ||
699 | smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_FS); | 703 | smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_FS); |
700 | smk_ad_setfield_u_fs_inode(&ad, inode); | 704 | smk_ad_setfield_u_fs_inode(&ad, inode); |
701 | return smk_curacc(smk_of_inode(inode), mask, &ad); | 705 | return smk_curacc(smk_of_inode(inode), mask, &ad); |