summaryrefslogtreecommitdiffstats
path: root/security/selinux/include/avc.h
diff options
context:
space:
mode:
authorStephen Smalley2018-12-12 16:10:55 +0100
committerGreg Kroah-Hartman2019-05-08 07:21:54 +0200
commit6b13ae52ac75da7970fde9d08c495a5671605473 (patch)
treef5ad193d361f63bbfb871ed9a56d25497ac364af /security/selinux/include/avc.h
parentgpio: mxc: add check to return defer probe if clock tree NOT ready (diff)
downloadkernel-qcow2-linux-6b13ae52ac75da7970fde9d08c495a5671605473.tar.gz
kernel-qcow2-linux-6b13ae52ac75da7970fde9d08c495a5671605473.tar.xz
kernel-qcow2-linux-6b13ae52ac75da7970fde9d08c495a5671605473.zip
selinux: avoid silent denials in permissive mode under RCU walk
commit 3a28cff3bd4bf43f02be0c4e7933aebf3dc8197e upstream. commit 0dc1ba24f7fff6 ("SELINUX: Make selinux cache VFS RCU walks safe") results in no audit messages at all if in permissive mode because the cache is updated during the rcu walk and thus no denial occurs on the subsequent ref walk. Fix this by not updating the cache when performing a non-blocking permission check. This only affects search and symlink read checks during rcu walk. Fixes: 0dc1ba24f7fff6 ("SELINUX: Make selinux cache VFS RCU walks safe") Reported-by: BMK <bmktuwien@gmail.com> Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security/selinux/include/avc.h')
-rw-r--r--security/selinux/include/avc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/security/selinux/include/avc.h b/security/selinux/include/avc.h
index ef899bcfd2cb..74ea50977c20 100644
--- a/security/selinux/include/avc.h
+++ b/security/selinux/include/avc.h
@@ -142,6 +142,7 @@ static inline int avc_audit(struct selinux_state *state,
#define AVC_STRICT 1 /* Ignore permissive mode. */
#define AVC_EXTENDED_PERMS 2 /* update extended permissions */
+#define AVC_NONBLOCKING 4 /* non blocking */
int avc_has_perm_noaudit(struct selinux_state *state,
u32 ssid, u32 tsid,
u16 tclass, u32 requested,