Bug 2187054

Summary: SELinux is preventing raid-check from 'search' accesses on the directory /home/common.
Product: [Fedora] Fedora Reporter: Stephen J Alexander <stevea12345>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: dwalsh, lvrabec, mmalik, omosnacek, pkoncity, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:caf5f4cec9a6fdf52f30d9a0fc2ceb6963ec2737408ae13b51f968bde88cafe0;VARIANT_ID=xfce;
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stephen J Alexander 2023-04-16 09:18:15 UTC
Description of problem:
F737, XFCE has unecessary dependency on mdadm.
mdadm defaults to enable raid-check.service even when mdadm not used.
raid-check script violates som SEL oplicy while (unecessarily) accessing user data directory.
SELinux is preventing raid-check from 'search' accesses on the directory /home/common.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that raid-check should be allowed search access on the common 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 'raid-check' --raw | audit2allow -M my-raidcheck
# semodule -X 300 -i my-raidcheck.pp

Additional Information:
Source Context                system_u:system_r:mdadm_t:s0
Target Context                unconfined_u:object_r:user_home_dir_t:s0
Target Objects                /home/common [ dir ]
Source                        raid-check
Source Path                   raid-check
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-37.19-1.fc37.noarch
Local Policy RPM              selinux-policy-targeted-37.19-1.fc37.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.2.8-200.fc37.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Wed Mar 22 19:11:02 UTC 2023
                              x86_64 x86_64
Alert Count                   16
First Seen                    2023-02-26 01:00:05 EST
Last Seen                     2023-04-16 04:44:15 EDT
Local ID                      0ba9cca0-f048-4cce-b420-b9bcb195bf03

Raw Audit Messages
type=AVC msg=audit(1681634655.183:3460): avc:  denied  { search } for  pid=192258 comm="raid-check" name="common" dev="dm-0" ino=264 scontext=system_u:system_r:mdadm_t:s0 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir permissive=0


Hash: raid-check,mdadm_t,user_home_dir_t,dir,search

Version-Release number of selected component:
selinux-policy-targeted-37.19-1.fc37.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.17.4
hashmarkername: setroubleshoot
kernel:         6.2.8-200.fc37.x86_64
type:           libreport

Comment 1 Stephen J Alexander 2023-08-06 13:12:33 UTC
The issue is that the (unnecessary) systemd unit uses bash, and bash has built-in PATH value that accessed 'common' via a link.
Please close.