Skip to content

Commit

Permalink
selinux: fix perf_event selinux policy for el8 platforms
Browse files Browse the repository at this point in the history
Since el8 selinux includes parts of the perf_event policy
from latest Fedora/el9 we cannot define it completely away
as we are currently.  Instead we need to carefully pick up
just the bits we need.
  • Loading branch information
natoscott committed Oct 27, 2022
1 parent 2d76b24 commit ed6a42b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/selinux/pcp.if
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,16 @@ ifndef(`glusterd_manage_log',`
#
ifndef(`kernel_manage_perf_event',`
interface(`kernel_manage_perf_event',`
# # perfmon, lockdown, manage_perf_event_perms unavailable on el8/el7
# allow $1 self:capability2 perfmon;
# # The confidentiality permission may not be needed, refer to kernel_write_perf_event()
# allow $1 self:lockdown confidentiality;
# allow $1 self:perf_event manage_perf_event_perms;
# manage_perf_event_perms unavailable on el7
ifdef(`manage_perf_event_perms',`
gen_require(`
type $1;
')
# perfmon, lockdown unavailable on el8
# allow $1 self:capability2 perfmon;
# allow $1 self:lockdown confidentiality;
allow $1 self:perf_event manage_perf_event_perms;
')
')
')

Expand Down

0 comments on commit ed6a42b

Please sign in to comment.