Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1822256

Summary: SELinux is preventing grub2-set-bootf from 'write' accesses on the directory /boot/grub2.
Product: [Fedora] Fedora Reporter: Andrew Stitcher <astitcher>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 30CC: dwalsh, grepl.miroslav, lvrabec, plautrba, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:3092cd349c84ac5ceca25440c6b750ba2b16494fba392c2d338ede7e88002b22;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-26 14:29:36 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:

Description Andrew Stitcher 2020-04-08 15:11:56 UTC
Description of problem:
Simple upgrade of my Fedora 30 box.

This box has been continuously upgraded for 5 or more years so there may be cruft lying around.
SELinux is preventing grub2-set-bootf from 'write' accesses on the directory /boot/grub2.

*****  Plugin kernel_modules (91.4 confidence) suggests   ********************

If you do not think grub2-set-bootf should try write access on grub2.
Then you may be under attack by a hacker, since confined applications should not need this access.
Do
contact your security administrator and report this issue.

*****  Plugin catchall (9.59 confidence) suggests   **************************

If you believe that grub2-set-bootf should be allowed write access on the grub2 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 'grub2-set-bootf' --raw | audit2allow -M my-grub2setbootf
# semodule -X 300 -i my-grub2setbootf.pp

Additional Information:
Source Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Context                system_u:object_r:boot_t:s0
Target Objects                /boot/grub2 [ dir ]
Source                        grub2-set-bootf
Source Path                   grub2-set-bootf
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           grub2-common-2.02-88.fc30.noarch
Policy RPM                    selinux-policy-3.14.3-57.fc30.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.5.9-100.fc30.x86_64 #1 SMP Thu
                              Mar 12 14:15:32 UTC 2020 x86_64 x86_64
Alert Count                   2
First Seen                    2020-04-08 10:24:30 EDT
Last Seen                     2020-04-08 10:24:53 EDT
Local ID                      510d453a-7fcd-46e5-9973-aa7db603acba

Raw Audit Messages
type=AVC msg=audit(1586355893.738:357): avc:  denied  { write } for  pid=9180 comm="grub2-set-bootf" name="grub2" dev="dm-3" ino=1316974 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:boot_t:s0 tclass=dir permissive=0


Hash: grub2-set-bootf,xdm_t,boot_t,dir,write

Version-Release number of selected component:
selinux-policy-3.14.3-57.fc30.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.12.0
hashmarkername: setroubleshoot
kernel:         5.5.10-100.fc30.x86_64
type:           libreport

Comment 1 Zdenek Pytela 2020-04-08 15:37:32 UTC
The following rawhide/base commit needs to be backported:

commit 43a040b61451c4bc7f0cfc0132843621f0359b52
Author: Nikola Knazekova <nknazeko>
Date:   Tue Sep 10 18:47:52 2019 +0200

    Introduce xdm_manage_bootloader booelan
    
    Created xdm_manage_bootloader boolean to create, read, write, and delete files in the /boot director & DOS filesystem.
    
    Fixed Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1750112#

Comment 2 Zdenek Pytela 2020-04-09 15:45:55 UTC
I've submitted a Fedora PR to backport existing commit:

https://github.com/fedora-selinux/selinux-policy/pull/346

Comment 3 Lukas Vrabec 2020-04-09 16:34:33 UTC
commit 51eba6d67c2ede38e16fb3c323abf234ccdcb203 (HEAD -> f30, origin/f30)
Author: Nikola Knazekova <nknazeko>
Date:   Tue Sep 10 18:47:52 2019 +0200

    Introduce xdm_manage_bootloader booelan
    
    Created xdm_manage_bootloader boolean to create, read, write, and delete files in the /boot director & DOS filesystem.
    
    Resolves: rhbz#1822256

Comment 4 Ben Cotton 2020-04-30 20:15:39 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora Update System 2020-05-13 14:43:35 UTC
FEDORA-2020-7db677a922 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2020-7db677a922

Comment 6 Fedora Update System 2020-05-14 07:25:19 UTC
FEDORA-2020-7db677a922 has been pushed to the Fedora 30 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-7db677a922`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-7db677a922

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

Comment 7 Ben Cotton 2020-05-26 14:29:36 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.