Bug 2317726 - SELinux is preventing daemon-init from 'watch' accesses on the directory /etc/mdevctl.d.
Summary: SELinux is preventing daemon-init from 'watch' accesses on the directory /etc...
Keywords:
Status: CLOSED DUPLICATE of bug 2314826
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 41
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:28a5992f4f52e774717d3567296...
: 2317958 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-10-10 01:22 UTC by Ian Laurie
Modified: 2024-10-11 11:48 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-10-10 07:22:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: description (2.38 KB, text/plain)
2024-10-10 01:22 UTC, Ian Laurie
no flags Details
File: os_info (683 bytes, text/plain)
2024-10-10 01:22 UTC, Ian Laurie
no flags Details

Description Ian Laurie 2024-10-10 01:22:04 UTC
Description of problem:
I think it was launching a VM using cockpit-machines but not sure.
SELinux is preventing daemon-init from 'watch' accesses on the directory /etc/mdevctl.d.

*****  Plugin catchall_labels (83.8 confidence) suggests   *******************

If you want to allow daemon-init to have watch access on the mdevctl.d directory
Then you need to change the label on /etc/mdevctl.d
Do
# semanage fcontext -a -t FILE_TYPE '/etc/mdevctl.d'
where FILE_TYPE is one of the following: mdevctl_conf_t, virt_cache_t, virt_common_var_run_t, virt_etc_rw_t, virt_var_run_t, virtnodedevd_t, virtnodedevd_var_run_t.
Then execute:
restorecon -v '/etc/mdevctl.d'


*****  Plugin catchall (17.1 confidence) suggests   **************************

If you believe that daemon-init should be allowed watch access on the mdevctl.d directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'daemon-init' --raw | audit2allow -M my-daemoninit
# semodule -X 300 -i my-daemoninit.pp

Additional Information:
Source Context                system_u:system_r:virtnodedevd_t:s0
Target Context                system_u:object_r:etc_t:s0
Target Objects                /etc/mdevctl.d [ dir ]
Source                        daemon-init
Source Path                   daemon-init
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           mdevctl-1.3.0-6.fc41.x86_64
SELinux Policy RPM            selinux-policy-targeted-41.20-1.fc41.noarch
Local Policy RPM              selinux-policy-targeted-41.20-1.fc41.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.11.2-300.fc41.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Fri Oct 4 16:44:08 UTC 2024 x86_64
Alert Count                   29
First Seen                    2024-10-10 12:18:54 AEDT
Last Seen                     2024-10-10 12:20:46 AEDT
Local ID                      5a009b3a-be0d-4f3b-9856-c35136a4355d

Raw Audit Messages
type=AVC msg=audit(1728523246.950:996): avc:  denied  { watch } for  pid=248478 comm="gmain" path="/etc/mdevctl.d" dev="sdc3" ino=452273 scontext=system_u:system_r:virtnodedevd_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=dir permissive=0


Hash: daemon-init,virtnodedevd_t,etc_t,dir,watch

Version-Release number of selected component:
selinux-policy-targeted-41.20-1.fc41.noarch

Additional info:
reporter:       libreport-2.17.15
reason:         SELinux is preventing daemon-init from 'watch' accesses on the directory /etc/mdevctl.d.
package:        selinux-policy-targeted-41.20-1.fc41.noarch
component:      selinux-policy
hashmarkername: setroubleshoot
type:           libreport
kernel:         6.11.2-300.fc41.x86_64
comment:        I think it was launching a VM using cockpit-machines but not sure.
component:      selinux-policy

Comment 1 Ian Laurie 2024-10-10 01:22:06 UTC
Created attachment 2051312 [details]
File: description

Comment 2 Ian Laurie 2024-10-10 01:22:08 UTC
Created attachment 2051313 [details]
File: os_info

Comment 3 Zdenek Pytela 2024-10-10 07:22:50 UTC

*** This bug has been marked as a duplicate of bug 2314826 ***

Comment 4 Zdenek Pytela 2024-10-11 11:48:44 UTC
*** Bug 2317958 has been marked as a duplicate of this bug. ***


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