Bug 2292253

Summary: SELinux is preventing zram-generator from 'create' accesses on the lnk_file var-lib-mock.mount.
Product: [Fedora] Fedora Reporter: Dominik 'Rathann' Mierzejewski <dominik>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 40CC: dominik, dwalsh, lvrabec, mmalik, omosnacek, pkoncity, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:c62c9f2de858af3c95775d4ca0d1e14d7ae0543a0e883203f335d94ae2ff9325;VARIANT_ID=workstation;
Fixed In Version: selinux-policy-40.24-1.fc40 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-07-19 01:46:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: os_info
none
File: description none

Description Dominik 'Rathann' Mierzejewski 2024-06-13 18:11:37 UTC
Description of problem:
This happened while updating selinux-policy to 40.22-1.fc40. I have a zram mount configured:

tail -n 4 /etc/systemd/zram-generator.conf 
[zram1]
zram-size = 12288
mount-point = /var/lib/mock
SELinux is preventing zram-generator from 'create' accesses on the lnk_file var-lib-mock.mount.

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

If you believe that zram-generator should be allowed create access on the var-lib-mock.mount lnk_file 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 'zram-generator' --raw | audit2allow -M my-zramgenerator
# semodule -X 300 -i my-zramgenerator.pp

Additional Information:
Source Context                system_u:system_r:systemd_zram_generator_t:s0
Target Context                system_u:object_r:systemd_fstab_generator_unit_fil
                              e_t:s0
Target Objects                var-lib-mock.mount [ lnk_file ]
Source                        zram-generator
Source Path                   zram-generator
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-40.22-1.fc40.noarch
Local Policy RPM              selinux-policy-targeted-40.22-1.fc40.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.8.11-300.fc40.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Mon May 27 14:53:33 UTC 2024
                              x86_64
Alert Count                   1
First Seen                    2024-06-13 20:08:17 CEST
Last Seen                     2024-06-13 20:08:17 CEST
Local ID                      3644e02d-2db6-4b1c-a2d9-0691f364dd73

Raw Audit Messages
type=AVC msg=audit(1718302097.98:504): avc:  denied  { create } for  pid=36100 comm="zram-generator" name="var-lib-mock.mount" scontext=system_u:system_r:systemd_zram_generator_t:s0 tcontext=system_u:object_r:systemd_fstab_generator_unit_file_t:s0 tclass=lnk_file permissive=1


Hash: zram-generator,systemd_zram_generator_t,systemd_fstab_generator_unit_file_t,lnk_file,create

Version-Release number of selected component:
selinux-policy-targeted-40.22-1.fc40.noarch

Additional info:
reporter:       libreport-2.17.15
type:           libreport
kernel:         6.8.11-300.fc40.x86_64
package:        selinux-policy-targeted-40.22-1.fc40.noarch
reason:         SELinux is preventing zram-generator from 'create' accesses on the lnk_file var-lib-mock.mount.
component:      selinux-policy
hashmarkername: setroubleshoot
component:      selinux-policy

Comment 1 Dominik 'Rathann' Mierzejewski 2024-06-13 18:11:39 UTC
Created attachment 2037176 [details]
File: os_info

Comment 2 Dominik 'Rathann' Mierzejewski 2024-06-13 18:11:41 UTC
Created attachment 2037177 [details]
File: description

Comment 3 Zdenek Pytela 2024-06-17 15:46:07 UTC
*** Bug 2292512 has been marked as a duplicate of this bug. ***

Comment 4 Zdenek Pytela 2024-06-17 16:05:30 UTC
*** Bug 2292513 has been marked as a duplicate of this bug. ***

Comment 5 Zdenek Pytela 2024-06-20 18:42:42 UTC
I believe this is fixed in selinux-policy-40.23-1.fc40

Comment 6 Fedora Update System 2024-07-17 16:15:38 UTC
FEDORA-2024-f30b2bffdc (selinux-policy-40.24-1.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-f30b2bffdc

Comment 7 Fedora Update System 2024-07-18 04:59:19 UTC
FEDORA-2024-f30b2bffdc has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f30b2bffdc`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-f30b2bffdc

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

Comment 8 Fedora Update System 2024-07-19 01:46:13 UTC
FEDORA-2024-f30b2bffdc (selinux-policy-40.24-1.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.