linux-stable/security/selinux/include
Stephen Smalley efd5ce8b23 selinux: fall back to ref-walk if audit is required
[ Upstream commit 0188d5c025 ]

commit bda0be7ad9 ("security: make inode_follow_link RCU-walk aware")
passed down the rcu flag to the SELinux AVC, but failed to adjust the
test in slow_avc_audit() to also return -ECHILD on LSM_AUDIT_DATA_DENTRY.
Previously, we only returned -ECHILD if generating an audit record with
LSM_AUDIT_DATA_INODE since this was only relevant from inode_permission.
Move the handling of MAY_NOT_BLOCK to avc_audit() and its inlined
equivalent in selinux_inode_permission() immediately after we determine
that audit is required, and always fall back to ref-walk in this case.

Fixes: bda0be7ad9 ("security: make inode_follow_link RCU-walk aware")
Reported-by: Will Deacon <will@kernel.org>
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-24 08:34:40 +01:00
..
audit.h
avc.h selinux: fall back to ref-walk if audit is required 2020-02-24 08:34:40 +01:00
avc_ss.h selinux: wrap AVC state 2018-03-20 16:58:17 -04:00
classmap.h selinux: use kernel linux/socket.h for genheaders and mdp 2019-05-04 09:20:10 +02:00
conditional.h selinux: wrap global selinux state 2018-03-01 18:48:02 -05:00
ibpkey.h selinux: Add a cache for quicker retreival of PKey SIDs 2017-05-23 12:28:12 -04:00
initial_sid_to_string.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
netif.h selinux: make the netif cache namespace aware 2014-09-10 17:09:57 -04:00
netlabel.h selinux: fix typo in selinux_netlbl_sctp_sk_clone declaration 2018-02-26 17:45:32 -05:00
netnode.h selinux: reduce the number of calls to synchronize_net() when flushing caches 2014-06-26 14:33:56 -04:00
netport.h selinux: reduce the number of calls to synchronize_net() when flushing caches 2014-06-26 14:33:56 -04:00
objsec.h selinux: wrap global selinux state 2018-03-01 18:48:02 -05:00
security.h selinux: wrap AVC state 2018-03-20 16:58:17 -04:00
xfrm.h security: Remove rtnl_lock() in selinux_xfrm_notify_policyload() 2018-03-29 13:47:53 -04:00