Bug 2114498

Summary: SELinux policy prevents xenstored from starting
Product: [Fedora] Fedora Reporter: W. Michael Petullo <mike>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 36CC: dwalsh, grepl.miroslav, lvrabec, mmalik, omosnace, pkoncity, vmojzis, zpytela
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: selinux-policy-36.14-1.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-20 01:44:40 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:

Description W. Michael Petullo 2022-08-02 18:17:19 UTC
Description of problem:
The SELinux policy is preventing xenstored from starting.

Version-Release number of selected component (if applicable):
selinux-policy-targeted-36.10-1.fc36.noarch

How reproducible:
Every time

Steps to Reproduce:
1. Boot the kernel under Xen as Dom0
2. Observe that xenstored does not start

Additional info:
Running "setenforce 0" allows xenstored to start. Here are the audit logs produced by running "systemctl start xenstored" when SELinux is in permissive mode:

Aug 02 13:10:18 doppelganger.flyn.org systemd[1]: Starting xenstored.service - The Xen xenstore...
Aug 02 13:10:18 doppelganger.flyn.org audit[949]: AVC avc:  denied  { search } for  pid=949 comm="launch-xenstore" name="fs" dev="proc" ino=15591 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:sysctl_fs_t:s0 tclass=dir permissive=1
Aug 02 13:10:18 doppelganger.flyn.org audit[949]: AVC avc:  denied  { read } for  pid=949 comm="launch-xenstore" name="nr_open" dev="proc" ino=15592 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:sysctl_fs_t:s0 tclass=file permissive=1
Aug 02 13:10:18 doppelganger.flyn.org audit[951]: AVC avc:  denied  { open } for  pid=951 comm="cat" path="/proc/sys/fs/nr_open" dev="proc" ino=15592 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:sysctl_fs_t:s0 tclass=file permissive=1
Aug 02 13:10:18 doppelganger.flyn.org audit[951]: AVC avc:  denied  { getattr } for  pid=951 comm="cat" path="/proc/sys/fs/nr_open" dev="proc" ino=15592 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:sysctl_fs_t:s0 tclass=file permissive=1
Aug 02 13:10:18 doppelganger.flyn.org audit[953]: AVC avc:  denied  { setrlimit } for  pid=953 comm="prlimit" scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:system_r:xenstored_t:s0 tclass=process permissive=1
Aug 02 13:10:18 doppelganger.flyn.org audit[949]: AVC avc:  denied  { getattr } for  pid=949 comm="launch-xenstore" path="/usr/bin/systemd-notify" dev="sda4" ino=4200844 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:systemd_notify_exec_t:s0 tclass=file permissive=1
Aug 02 13:10:18 doppelganger.flyn.org audit[949]: AVC avc:  denied  { execute } for  pid=949 comm="launch-xenstore" name="systemd-notify" dev="sda4" ino=4200844 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:systemd_notify_exec_t:s0 tclass=file permissive=1
Aug 02 13:10:18 doppelganger.flyn.org audit[949]: AVC avc:  denied  { read } for  pid=949 comm="launch-xenstore" name="systemd-notify" dev="sda4" ino=4200844 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:systemd_notify_exec_t:s0 tclass=file permissive=1
Aug 02 13:10:18 doppelganger.flyn.org audit[956]: AVC avc:  denied  { open } for  pid=956 comm="launch-xenstore" path="/usr/bin/systemd-notify" dev="sda4" ino=4200844 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:systemd_notify_exec_t:s0 tclass=file permissive=1
Aug 02 13:10:18 doppelganger.flyn.org audit[956]: AVC avc:  denied  { execute_no_trans } for  pid=956 comm="launch-xenstore" path="/usr/bin/systemd-notify" dev="sda4" ino=4200844 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:systemd_notify_exec_t:s0 tclass=file permissive=1
Aug 02 13:10:18 doppelganger.flyn.org xenstored[955]: Checking store ...
Aug 02 13:10:18 doppelganger.flyn.org xenstored[955]: Checking store complete.
Aug 02 13:10:18 doppelganger.flyn.org launch-xenstore[949]: Starting /usr/sbin/xenstored...
Aug 02 13:10:18 doppelganger.flyn.org xen-init-dom0[959]: Done setting up Dom0
Aug 02 13:10:19 doppelganger.flyn.org systemd[1]: Started xenstored.service - The Xen xenstore.
Aug 02 13:10:19 doppelganger.flyn.org audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=xenstored comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

Comment 1 Zdenek Pytela 2022-08-09 14:43:29 UTC
The required SELinux permissions were added but note we are unable to test if it is sufficient if it requires kernel which is not in Fedora.

Comment 2 Fedora Update System 2022-08-12 07:56:19 UTC
FEDORA-2022-70c63dd1e2 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-70c63dd1e2

Comment 3 Fedora Update System 2022-08-13 01:09:31 UTC
FEDORA-2022-70c63dd1e2 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-70c63dd1e2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-70c63dd1e2

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2022-08-20 01:44:40 UTC
FEDORA-2022-70c63dd1e2 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.