Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1696144

Summary: SELinux preventing systemd from creating mountpoint
Product: Red Hat Enterprise Linux 8 Reporter: adam winberg <adam.winberg>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: jsynacek, kdsouza, kwalker, lvrabec, mmalik, plautrba, ssekidde, systemd-maint-list, zpytela
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.1   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.14.3-12.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 22:11:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description adam winberg 2019-04-04 08:38:22 UTC
Description of problem:
SELinux prevents systemd from creating mountpoints with message:

-----------------------------
SELinux is preventing systemd from create access on the directory X
...
Raw Audit Messages
type=AVC msg=audit(1554360444.745:8539): avc:  denied  { create } for  pid=1 comm="systemd" name="24" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:default_t:s0 tclass=dir permissive=0
-----------------------------

Seems like systemd (init_t) tries to create the mountpoint with 'default_t' context which SELinux does not allow. 


Version-Release number of selected component (if applicable):
systemd-239-8.el8.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create fstab line for mount, for example:
nfsserver:/data/temp	/test/temp	nfs	vers=4.0,sec=krb5	0	0
2. Run 'systemctl daemon-reload' to generate systemd mount files.
3. Run 'systemctl start test-temp.mount'

Actual results:
Unit start fails with 
test-temp.mount: Failed to check directory /test/temp: No such file or directory

because of SELinux denial. 

Expected results:
SELinux should not prevent systemd from creating mountpoint directories. 

Additional info:

Comment 1 Milos Malik 2019-04-04 09:56:20 UTC
Reproduced in permissive mode too:
----
type=AVC msg=audit(04/04/2019 05:54:47.729:307) : avc:  denied  { create } for  pid=1 comm=systemd name=test scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:default_t:s0 tclass=dir permissive=1 
----

# ls -dZ /test/
system_u:object_r:default_t:s0 /test/
# ls -dZ /test/temp/
system_u:object_r:default_t:s0 /test/temp/
#

Comment 7 errata-xmlrpc 2019-11-05 22:11:10 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.

https://access.redhat.com/errata/RHBA-2019:3547