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 1690291 - SELinux is preventing /usr/bin/qemu-ga from read access on mounted point
Summary: SELinux is preventing /usr/bin/qemu-ga from read access on mounted point
Keywords:
Status: CLOSED DUPLICATE of bug 1747960
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.2
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-19 09:00 UTC by yafu
Modified: 2019-09-03 19:02 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-03 19:02:05 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description yafu 2019-03-19 09:00:14 UTC
DSELinux is preventing /usr/bin/qemu-ga from read access on the directory /mnt.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/mnt default label should be mnt_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /mnt

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that qemu-ga should be allowed read access on the mnt 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 'qemu-ga' --raw | audit2allow -M my-qemuga
# semodule -X 300 -i my-qemuga.pp

Additional Information:
Source Context                system_u:system_r:virt_qemu_ga_t:s0
Target Context                system_u:object_r:unlabeled_t:s0
Target Objects                /mnt [ dir ]
Source                        qemu-ga
Source Path                   /usr/bin/qemu-ga
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           
Target RPM Packages           filesystem-3.8-2.el8.x86_64
Policy RPM                    selinux-policy-3.14.1-61.el8.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 4.18.0-80.el8.x86_64
                              #1 SMP Wed Mar 13 12:02:46 UTC 2019 x86_64 x86_64
Alert Count                   47
First Seen                    2019-03-19 03:14:15 EDT
Last Seen                     2019-03-19 04:44:59 EDT
Local ID                      aed26cc9-3f4d-42cc-8f9f-a33ac2c4bf53

Raw Audit Messages
type=AVC msg=audit(1552985099.106:128): avc:  denied  { read } for  pid=875 comm="qemu-ga" name="/" dev="sdb" ino=2 scontext=system_u:system_r:virt_qemu_ga_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir permissive=0


Hash: qemu-ga,virt_qemu_ga_t,unlabeled_t,dir,read



Additional info:
1.It works well with selinux-policy-3.13.1-229.el7.noarch.

Comment 1 Zdenek Pytela 2019-03-19 09:10:10 UTC
Hi,

It looks like the /mnt directory has invalid label: The unlabeled_t label is usually displayed when a file was created in SELinux disabled state or when its actual label does not currently exist. Along with the restorecon plugin suggestion, you can fix the label with a single command:

  # /sbin/restorecon -v /mnt

However, for files and directories which are a part of base system it is very unusual. Did you install the system with SELinux enabled as it is by default? Are you able to reproduce the issue?

Comment 2 yafu 2019-03-19 09:22:47 UTC
(In reply to Zdenek Pytela from comment #1)
> Hi,
> 
> It looks like the /mnt directory has invalid label: The unlabeled_t label is
> usually displayed when a file was created in SELinux disabled state or when
> its actual label does not currently exist. Along with the restorecon plugin
> suggestion, you can fix the label with a single command:
> 
>   # /sbin/restorecon -v /mnt
> 
> However, for files and directories which are a part of base system it is
> very unusual. Did you install the system with SELinux enabled as it is by
> default? Are you able to reproduce the issue?

Yes, before mount block device to /mnt, the label of /mnt is:
#ll -dZ /mnt/
drwxr-xr-x. 2 root root system_u:object_r:mnt_t:s0 6 Aug 12  2018 /mnt/

After mount block device to /mnt, the label of /mnt is:
# ll -dZ /mnt/
drwxr-xr-x. 2 root root system_u:object_r:unlabeled_t:s0 22 Mar 19 15:13 /mnt/

Comment 3 Zdenek Pytela 2019-03-19 13:37:03 UTC
What is the filesystem on the device mounted to /mnt? How was it created, does it support SELinux?

Comment 4 yafu 2019-03-20 03:23:34 UTC
(In reply to Zdenek Pytela from comment #3)
> What is the filesystem on the device mounted to /mnt? How was it created,
> does it support SELinux?


I tested ext4 and xfs, created by mkfs.XXX /dev/XXX. And both can reproduce the issue.

Comment 7 Lukas Vrabec 2019-09-03 19:02:05 UTC

*** This bug has been marked as a duplicate of bug 1747960 ***


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