Bug 1833502

Summary: SELinux is preventing systemd-modules from 'open' accesses on the file /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c.
Product: [Fedora] Fedora Reporter: thedatum+bz
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 32CC: aannoaanno, amessina, artur.tanistra, dwalsh, grepl.miroslav, lvrabec, plautrba, vmojzis, zdenek.zikan, zpytela
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:64188d662e356889661eba67a7f812f1115f2cf6e0ae88df8739ba309b0044a5;
Fixed In Version: selinux-policy-3.14.5-40.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-11 22:57:14 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:
Bug Depends On: 1812955    
Bug Blocks:    

Description thedatum+bz 2020-05-08 18:29:48 UTC
Description of problem:
Occurred during a kernel upgrade.
SELinux is preventing systemd-modules from 'open' accesses on the file /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c.

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

If you believe that systemd-modules should be allowed open access on the SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c 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 'systemd-modules' --raw | audit2allow -M my-systemdmodules
# semodule -X 300 -i my-systemdmodules.pp

Additional Information:
Source Context                system_u:system_r:systemd_modules_load_t:s0
Target Context                system_u:object_r:efivarfs_t:s0
Target Objects                /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca
                              -11d2-aa0d-00e098032b8c [ file ]
Source                        systemd-modules
Source Path                   systemd-modules
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-3.14.5-38.fc32.noarch
Local Policy RPM              selinux-policy-targeted-3.14.5-38.fc32.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.6.8-300.fc32.x86_64 #1 SMP Wed
                              Apr 29 19:01:34 UTC 2020 x86_64 x86_64
Alert Count                   10
First Seen                    2020-05-03 20:11:19 EDT
Last Seen                     2020-05-08 14:14:40 EDT
Local ID                      ea503070-e4c0-47e6-a21d-8d9d903b37e0

Raw Audit Messages
type=AVC msg=audit(1588961680.603:3420): avc:  denied  { open } for  pid=519109 comm="systemd-modules" path="/sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c" dev="efivarfs" ino=79 scontext=system_u:system_r:systemd_modules_load_t:s0 tcontext=system_u:object_r:efivarfs_t:s0 tclass=file permissive=0


Hash: systemd-modules,systemd_modules_load_t,efivarfs_t,file,open

Version-Release number of selected component:
selinux-policy-targeted-3.14.5-38.fc32.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.12.0
hashmarkername: setroubleshoot
kernel:         5.6.8-300.fc32.x86_64
type:           libreport

Comment 1 Zdenek Pytela 2020-05-25 13:43:17 UTC
*** Bug 1829700 has been marked as a duplicate of this bug. ***

Comment 2 Zdenek Pytela 2020-06-03 14:15:46 UTC
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy/pull/362

Comment 3 Lukas Vrabec 2020-06-03 14:20:43 UTC
commit ebe2e4f111c54df85ce7fd84cb1ba89314c4fda3
Author: Zdenek Pytela <zpytela>
Date:   Wed Jun 3 16:14:02 2020 +0200

    Allow systemd_modules_load_t to read efivarfs
    
    Resolves: rhbz#1833502

Comment 4 Fedora Update System 2020-06-05 13:42:16 UTC
FEDORA-2020-ca8855e4de has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-ca8855e4de

Comment 5 Fedora Update System 2020-06-08 01:46:07 UTC
FEDORA-2020-ca8855e4de has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-ca8855e4de`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-ca8855e4de

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

Comment 6 Fedora Update System 2020-06-11 22:57:14 UTC
selinux-policy-3.14.5-40.fc32 has been pushed to the Fedora 32 stable repository. If problems still persist, please make note of it in this bug report.