RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 727130 - SELinux is preventing /sbin/grubby "search" access to /boot/efi
Summary: SELinux is preventing /sbin/grubby "search" access to /boot/efi
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-01 11:42 UTC by Yury V. Zaytsev
Modified: 2012-10-16 10:56 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.7.19-106.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 10:10:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1511 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2011-12-06 00:39:17 UTC

Description Yury V. Zaytsev 2011-08-01 11:42:01 UTC
Description of problem:

I am getting the following denials in my logs:

Jul 25 19:21:08 XXX setroubleshoot: SELinux is preventing /usr/bin/python "search" access to /boot/efi. For complete SELinux messages. run sealert -l b6a006e4-78c7-43c3-8209-6ad6abec057b
Jul 25 19:21:08 XXX setroubleshoot: SELinux is preventing /sbin/grubby "search" access to /boot/efi. For complete SELinux messages. run sealert -l b6a006e4-78c7-43c3-8209-6ad6abec057b
Jul 25 19:21:08 XXX setroubleshoot: SELinux is preventing /sbin/grubby "search" access to /boot/efi. For complete SELinux messages. run sealert -l b6a006e4-78c7-43c3-8209-6ad6abec057b
Jul 25 19:21:08 XXX setroubleshoot: SELinux is preventing /sbin/grubby "search" access to /boot/efi. For complete SELinux messages. run sealert -l b6a006e4-78c7-43c3-8209-6ad6abec057b

I'm not 100% confident of what I was doing at that time, but I think I've been installing a kernel update. This system is an x86_64 machine which can, however, only boot via EFI, hence I do indeed have an EFI boot partition.

audit2allow generates the following module:

module grubby 1.0;

require {
        type dosfs_t;
        type kdumpgui_t;
        class dir search;
}

#============= kdumpgui_t ==============
allow kdumpgui_t dosfs_t:dir search;

Looks like the hole it's trying to punch is too big, but I leave it here for your consideration.

Version-Release number of selected component (if applicable):

# rpm -q selinux-policy grubby kernel
selinux-policy-3.7.19-93.el6_1.2.noarch
grubby-7.0.15-2.el6.x86_64
kernel-2.6.32-131.2.1.el6.x86_64
kernel-2.6.32-131.4.1.el6.x86_64
kernel-2.6.32-131.6.1.el6.x86_64

Additional info:

SELinux is preventing /sbin/grubby "search" access to /boot/efi.

Detailed Description:

SELinux denied access requested by grubby. /boot/efi may be a mislabeled.
/boot/efi default SELinux type is boot_t, but its current type is dosfs_t.
Changing this file back to the default type, may fix your problem.

File contexts can be assigned to a file in the following ways.

  * Files created in a directory receive the file context of the parent
    directory by default.
  * The SELinux policy might override the default label inherited from the
    parent directory by specifying a process running in context A which creates
    a file in a directory labeled B will instead create the file with label C.
    An example of this would be the dhcp client running with the dhclient_t type
    and creating a file in the directory /etc. This file would normally receive
    the etc_t type due to parental inheritance but instead the file is labeled
    with the net_conf_t type because the SELinux policy specifies this.
  * Users can change the file context on a file using tools such as chcon, or
    restorecon.

This file could have been mislabeled either by user error, or if an normally
confined application was run under the wrong domain.

However, this might also indicate a bug in SELinux because the file should not
have been labeled with this type.

If you believe this is a bug, please file a bug report against this package.

Allowing Access:

You can restore the default system context to this file by executing the
restorecon command. restorecon '/boot/efi', if this file is a directory, you can
recursively restore using restorecon -R '/boot/efi'.

Fix Command:

/sbin/restorecon '/boot/efi'

Additional Information:

Source Context                system_u:system_r:kdumpgui_t:s0-s0:c0.c1023
Target Context                system_u:object_r:dosfs_t:s0
Target Objects                /boot/efi [ dir ]
Source                        system-config-k
Source Path                   /usr/bin/python
Port                          <Unknown>
Host                          XXX
Source RPM Packages           grubby-7.0.15-2.el6
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-93.el6_1.2
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   restorecon
Host Name                     XXX
Platform                      Linux XXX
                              2.6.32-131.6.1.el6.x86_64 #1 SMP Mon Jun 20
                              14:15:38 EDT 2011 x86_64 x86_64
Alert Count                   4
First Seen                    Mon Jul 25 19:21:06 2011
Last Seen                     Mon Jul 25 19:21:06 2011
Local ID                      b6a006e4-78c7-43c3-8209-6ad6abec057b
Line Numbers                  

Raw Audit Messages            

node=XXX type=AVC msg=audit(1311614466.735:235): avc:  denied  { search } for  pid=7849 comm="grubby" name="/" dev=sdb1 ino=1 scontext=system_u:system_r:kdumpgui_t:s0-s0:c0.c1023 tcontext=system_u:object_r:dosfs_t:s0 tclass=dir

node=XXX type=SYSCALL msg=audit(1311614466.735:235): arch=c000003e syscall=2 success=no exit=-13 a0=408629 a1=0 a2=c74440 a3=7fff3daf79d0 items=0 ppid=7774 pid=7849 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="grubby" exe="/sbin/grubby" subj=system_u:system_r:kdumpgui_t:s0-s0:c0.c1023 key=(null)

Comment 2 Miroslav Grepl 2011-08-02 06:49:14 UTC
Fixed in  selinux-policy-3.7.19-106.el6

Comment 6 errata-xmlrpc 2011-12-06 10:10:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1511.html


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