Bug 1941464
Summary: | SELinux is preventing /usr/sbin/virtlockd from create access on the directory lockd | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | yafu <yafu> | |
Component: | selinux-policy | Assignee: | Zdenek Pytela <zpytela> | |
Status: | CLOSED ERRATA | QA Contact: | Milos Malik <mmalik> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 8.4 | CC: | lvrabec, mmalik, nknazeko, plautrba, ssekidde, zpytela | |
Target Milestone: | rc | Keywords: | AutoVerified, Triaged | |
Target Release: | 8.5 | |||
Hardware: | Unspecified | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | selinux-policy-3.14.3-68.el8 | Doc Type: | No Doc Update | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1974875 (view as bug list) | Environment: | ||
Last Closed: | 2021-11-09 19:42:58 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1974875 |
Description
yafu
2021-03-22 08:16:32 UTC
Nikola, Can you assess if this permission request is expected, given the current state of the libvirt policy in RHEL 8? Hi Zdenko the new libvirt policy for new virt drivers is not developed for RHEL8. In the libvirt policy for RHEL8 and also in new libvirt policy, filecontext for /var/lib/libvirt/lockd should be virt_var_lockd_t, instead of virt_var_lib_t. Merged in rawhide: commit f83261b20273c167520949c5a9e8b38ac9a18f93 (HEAD -> rawhide, upstream/rawhide) Author: Nikola Knazekova <nknazeko> Date: Tue Apr 27 15:04:44 2021 +0200 Allow virtlogd_t to create virt_var_lockd_t dir Allow virtlogd_t to create dir named "lockd" with label virt_var_lockd_t in parent directory labeled as virt_var_lib_t. Make the virt_var_lockd_t type usable for files in a filesystem. Fixed BZ1941464. Tested on RHEL8.4. Signed-off-by: Nikola Knazekova <nknazeko> When old selinux-policy is installed, the following SELinux denial appears in enforcing mode: ---- type=PROCTITLE msg=audit(05/20/2021 12:15:04.945:439) : proctitle=/usr/sbin/virtlockd type=PATH msg=audit(05/20/2021 12:15:04.945:439) : item=1 name=/var/lib/libvirt/lockd nametype=CREATE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(05/20/2021 12:15:04.945:439) : item=0 name=/var/lib/libvirt/ inode=529464 dev=fd:01 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:virt_var_lib_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(05/20/2021 12:15:04.945:439) : cwd=/ type=SYSCALL msg=audit(05/20/2021 12:15:04.945:439) : arch=x86_64 syscall=mkdir success=no exit=EACCES(Permission denied) a0=0x56307fcdec00 a1=0700 a2=0x7ffed3f76950 a3=0x7f59ccce78ff items=2 ppid=1 pid=6654 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=virtlockd exe=/usr/sbin/virtlockd subj=system_u:system_r:virtlogd_t:s0-s0:c0.c1023 key=(null) type=AVC msg=audit(05/20/2021 12:15:04.945:439) : avc: denied { create } for pid=6654 comm=virtlockd name=lockd scontext=system_u:system_r:virtlogd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:virt_var_lib_t:s0 tclass=dir permissive=0 ---- When old selinux-policy is installed, the following SELinux denial appears in permissive mode: ---- type=PROCTITLE msg=audit(05/20/2021 12:16:59.367:444) : proctitle=/usr/sbin/virtlockd type=PATH msg=audit(05/20/2021 12:16:59.367:444) : item=1 name=/var/lib/libvirt/lockd inode=18874568 dev=fd:01 mode=dir,700 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:virt_var_lib_t:s0 nametype=CREATE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(05/20/2021 12:16:59.367:444) : item=0 name=/var/lib/libvirt/ inode=529464 dev=fd:01 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:virt_var_lib_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(05/20/2021 12:16:59.367:444) : cwd=/ type=SYSCALL msg=audit(05/20/2021 12:16:59.367:444) : arch=x86_64 syscall=mkdir success=yes exit=0 a0=0x56307fce2590 a1=0700 a2=0x7ffed3f76950 a3=0x7f59ccce78ff items=2 ppid=1 pid=6654 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=virtlockd exe=/usr/sbin/virtlockd subj=system_u:system_r:virtlogd_t:s0-s0:c0.c1023 key=(null) type=AVC msg=audit(05/20/2021 12:16:59.367:444) : avc: denied { create } for pid=6654 comm=virtlockd name=lockd scontext=system_u:system_r:virtlogd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:virt_var_lib_t:s0 tclass=dir permissive=1 ---- Hi, Can you please check if the scenario in #c0 is applicable to RHEL 9, too? (In reply to Zdenek Pytela from comment #17) > Hi, > > Can you please check if the scenario in #c0 is applicable to RHEL 9, too? Hi Zdenek, I tested comment #0 with selinux-policy-34.1.8-1.el9.noarch, the avc deny is different with comment #0: # ausearch -m avc | grep -i virtlockd type=AVC msg=audit(1623802355.506:1681): avc: denied { read append } for pid=187608 comm="virtlockd" name="system.token" dev="tmpfs" ino=2505 scontext=system_u:system_r:virtlogd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:virt_var_run_t:s0 tclass=file permissive=0 And it seems the same issue with https://bugzilla.redhat.com/show_bug.cgi?id=1966842. (In reply to yafu from comment #18) > (In reply to Zdenek Pytela from comment #17) > > Hi, > > > > Can you please check if the scenario in #c0 is applicable to RHEL 9, too? > > Hi Zdenek, > > I tested comment #0 with selinux-policy-34.1.8-1.el9.noarch, the avc deny is > different with comment #0: > # ausearch -m avc | grep -i virtlockd > type=AVC msg=audit(1623802355.506:1681): avc: denied { read append } for > pid=187608 comm="virtlockd" name="system.token" dev="tmpfs" ino=2505 > scontext=system_u:system_r:virtlogd_t:s0-s0:c0.c1023 > tcontext=system_u:object_r:virt_var_run_t:s0 tclass=file permissive=0 > > And it seems the same issue with > https://bugzilla.redhat.com/show_bug.cgi?id=1966842. Hi, This issue will be addressed in the RHEL 9 clone bz#1969209, so we probably need to retest the #c0 scenario when the new build is available. 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-2021:4420 |