diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2021-01-16 23:40:54 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2021-06-11 20:05:18 +0300 |
commit | b17ec22fb339bfcb1eadd5f5e196dc705dcf3949 (patch) | |
tree | 26cf2d5c9a8e4c30896413f23c600d7f1d740003 /security/selinux/hooks.c | |
parent | d0a83314db291fdf2e1c36102212c80e01022d6d (diff) | |
download | linux-b17ec22fb339bfcb1eadd5f5e196dc705dcf3949.tar.xz |
selinux: slow_avc_audit has become non-blocking
dump_common_audit_data() is safe to use under rcu_read_lock() now;
no need for AVC_NONBLOCKING and games around it
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index fc6a3ab7e179..4e64f681e5d1 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -3164,17 +3164,13 @@ static noinline int audit_inode_permission(struct inode *inode, { struct common_audit_data ad; struct inode_security_struct *isec = selinux_inode(inode); - int rc; ad.type = LSM_AUDIT_DATA_INODE; ad.u.inode = inode; - rc = slow_avc_audit(&selinux_state, + return slow_avc_audit(&selinux_state, current_sid(), isec->sid, isec->sclass, perms, audited, denied, result, &ad); - if (rc) - return rc; - return 0; } static int selinux_inode_permission(struct inode *inode, int mask) @@ -3209,8 +3205,7 @@ static int selinux_inode_permission(struct inode *inode, int mask) return PTR_ERR(isec); rc = avc_has_perm_noaudit(&selinux_state, - sid, isec->sid, isec->sclass, perms, - no_block ? AVC_NONBLOCKING : 0, + sid, isec->sid, isec->sclass, perms, 0, &avd); audited = avc_audit_required(perms, &avd, rc, from_access ? FILE__AUDIT_ACCESS : 0, @@ -3218,10 +3213,6 @@ static int selinux_inode_permission(struct inode *inode, int mask) if (likely(!audited)) return rc; - /* fall back to ref-walk if we have to generate audit */ - if (no_block) - return -ECHILD; - rc2 = audit_inode_permission(inode, perms, audited, denied, rc); if (rc2) return rc2; |