mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-13 17:00:51 +00:00
libselinux: Only audit permissions specified by the policy
Only audit the permissions specified by the policy, excluding any permissions specified via dontaudit or not specified via auditallow. This only shows up when a single avc_has_perm() call is made with multiple permissions where some of those permissions are dontaudit'd or auditallow'd while others are not. The corresponding kernel patch has already been applied, see: http://git.kernel.org/?p=linux/kernel/git/jmorris/security-testing-2.6.git;a=commit;h=b6cac5a30b325e14cda425670bb3568d3cad0aa8 Signed-off-by: Stephen D. Smalley <sds@tycho.nsa.gov>
This commit is contained in:
parent
9a1814832b
commit
0fc6c7762c
@ -694,17 +694,14 @@ void avc_audit(security_id_t ssid, security_id_t tsid,
|
||||
access_vector_t denied, audited;
|
||||
|
||||
denied = requested & ~avd->allowed;
|
||||
if (denied) {
|
||||
audited = denied;
|
||||
if (!(audited & avd->auditdeny))
|
||||
return;
|
||||
} else if (!requested || result) {
|
||||
if (denied)
|
||||
audited = denied & avd->auditdeny;
|
||||
else if (!requested || result)
|
||||
audited = denied = requested;
|
||||
} else {
|
||||
audited = requested;
|
||||
if (!(audited & avd->auditallow))
|
||||
return;
|
||||
}
|
||||
else
|
||||
audited = requested & avd->auditallow;
|
||||
if (!audited)
|
||||
return;
|
||||
#if 0
|
||||
if (!check_avc_ratelimit())
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user