summaryrefslogtreecommitdiff
path: root/security/selinux/avc.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2015-03-23 13:37:39 +1100
committerBen Hutchings <ben@decadent.org.uk>2019-07-09 22:03:45 +0100
commit872dfecfaf15655f4c77b51d0077792df7c26bcb (patch)
treefae8f59577aa8a1dd7351d2d0c57c71f6ceff6ae /security/selinux/avc.c
parent7fe7a3f790837550ffefa96123d04cf876015add (diff)
security/selinux: pass 'flags' arg to avc_audit() and avc_has_perm_flags()
commit 7b20ea2579238f5e0da4bc93276c1b63c960c9ef upstream. This allows MAY_NOT_BLOCK to be passed, in RCU-walk mode, through the new avc_has_perm_flags() to avc_audit() and thence the slow_avc_audit. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> [bwh: Backported to 3.16 as dependency of commit 3a28cff3bd4b "selinux: avoid silent denials in permissive mode under RCU walk"] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'security/selinux/avc.c')
-rw-r--r--security/selinux/avc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index a18f1fa6440b..03d1043a6906 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -768,7 +768,23 @@ int avc_has_perm(u32 ssid, u32 tsid, u16 tclass,
rc = avc_has_perm_noaudit(ssid, tsid, tclass, requested, 0, &avd);
- rc2 = avc_audit(ssid, tsid, tclass, requested, &avd, rc, auditdata);
+ rc2 = avc_audit(ssid, tsid, tclass, requested, &avd, rc, auditdata, 0);
+ if (rc2)
+ return rc2;
+ return rc;
+}
+
+int avc_has_perm_flags(u32 ssid, u32 tsid, u16 tclass,
+ u32 requested, struct common_audit_data *auditdata,
+ int flags)
+{
+ struct av_decision avd;
+ int rc, rc2;
+
+ rc = avc_has_perm_noaudit(ssid, tsid, tclass, requested, 0, &avd);
+
+ rc2 = avc_audit(ssid, tsid, tclass, requested, &avd, rc,
+ auditdata, flags);
if (rc2)
return rc2;
return rc;