RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2098189 - SELinux prevents the keepalived process from reading the /sys/devices/system/cpu/ directory
Summary: SELinux prevents the keepalived process from reading the /sys/devices/system/...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.7
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-17 14:14 UTC by Milos Malik
Modified: 2022-11-08 12:21 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-3.14.3-103.el8
Doc Type: No Doc Update
Doc Text:
Clone Of: 2098130
Environment:
Last Closed: 2022-11-08 10:44:31 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1261 0 None Merged Allow keepalived read the contents of the sysfs filesystem 2022-06-27 11:40:56 UTC
Red Hat Issue Tracker RHELPLAN-125607 0 None None None 2022-06-17 14:27:03 UTC
Red Hat Product Errata RHBA-2022:7691 0 None None None 2022-11-08 10:44:46 UTC

Description Milos Malik 2022-06-17 14:14:59 UTC
+++ This bug was initially created as a clone of Bug #2098130 +++

Description of problem:

When the keepalived service is configured with vrrp_track_process, SELinux blocks certain actions.

Version-Release number of selected component (if applicable):
keepalived-2.1.5-8.el8.x86_64
selinux-policy-3.14.3-100.el8.noarch
selinux-policy-targeted-3.14.3-100.el8.noarch

How reproducible:

Always with vrrp_track_process specified

Steps to Reproduce:
1. Include the following lines in the /etc/keepalived/keepalived.conf file

vrrp_track_process track_haproxy {
   process haproxy
   quorum 1
   delay 2
   weight 2
}

2. start/restart the keepalived service

Actual results (enforcing mode):
----
type=PROCTITLE msg=audit(06/17/2022 10:13:24.020:421) : proctitle=/usr/sbin/keepalived -D 
type=PATH msg=audit(06/17/2022 10:13:24.020:421) : item=0 name=/sys/devices/system/cpu inode=39 dev=00:15 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:sysfs_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 
type=CWD msg=audit(06/17/2022 10:13:24.020:421) : cwd=/ 
type=SYSCALL msg=audit(06/17/2022 10:13:24.020:421) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=AT_FDCWD a1=0x7f1d0de91bfc a2=O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC a3=0x0 items=1 ppid=10609 pid=10611 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=keepalived exe=/usr/sbin/keepalived subj=system_u:system_r:keepalived_t:s0 key=(null) 
type=AVC msg=audit(06/17/2022 10:13:24.020:421) : avc:  denied  { read } for  pid=10611 comm=keepalived name=cpu dev="sysfs" ino=39 scontext=system_u:system_r:keepalived_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=0 
----

Expected results:
 * no SELinux denials

Comment 1 Milos Malik 2022-06-17 14:16:20 UTC
Actual results (permissive mode):
----
type=PROCTITLE msg=audit(06/17/2022 10:15:31.978:426) : proctitle=/usr/sbin/keepalived -D 
type=PATH msg=audit(06/17/2022 10:15:31.978:426) : item=0 name=/sys/devices/system/cpu inode=39 dev=00:15 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:sysfs_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 
type=CWD msg=audit(06/17/2022 10:15:31.978:426) : cwd=/ 
type=SYSCALL msg=audit(06/17/2022 10:15:31.978:426) : arch=x86_64 syscall=openat success=yes exit=10 a0=AT_FDCWD a1=0x7f44e02d3bfc a2=O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC a3=0x0 items=1 ppid=10633 pid=10635 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=keepalived exe=/usr/sbin/keepalived subj=system_u:system_r:keepalived_t:s0 key=(null) 
type=AVC msg=audit(06/17/2022 10:15:31.978:426) : avc:  denied  { read } for  pid=10635 comm=keepalived name=cpu dev="sysfs" ino=39 scontext=system_u:system_r:keepalived_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=1 
----

Comment 13 errata-xmlrpc 2022-11-08 10:44:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (selinux-policy bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7691


Note You need to log in before you can comment on or make changes to this bug.