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 1343929 - [SELinux]: kerberos mount fails with selinux denials in audit logs.
Summary: [SELinux]: kerberos mount fails with selinux denials in audit logs.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.2
Hardware: x86_64
OS: Linux
high
urgent
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
Marie Hornickova
URL:
Whiteboard:
Depends On:
Blocks: 1344630
TreeView+ depends on / blocked
 
Reported: 2016-06-08 10:47 UTC by Prasanth
Modified: 2016-11-04 02:30 UTC (History)
11 users (show)

Fixed In Version: selinux-policy-3.13.1-78.el7
Doc Type: If docs needed, set a value
Doc Text:
When the nfs-ganesha server was set up with a volume, and an attempt to mount this volume on a client within the Kerberos network was made, SELinux denied this Kerberos mount. This update ensures that the Gluster SELinux domain can read the Kerberos keytab files. As a result, the Kerberos mount is successful in the described scenario.
Clone Of: 1343925
: 1344630 (view as bug list)
Environment:
Last Closed: 2016-11-04 02:30:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2283 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2016-11-03 13:36:25 UTC

Description Prasanth 2016-06-08 10:47:06 UTC
+++ This bug was initially created as a clone of Bug #1343925 +++

Description of problem:

kerberos mount fails with selinux denials in audit logs.

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

nfs-ganesha-2.3.1-7

How reproducible:

Always

Steps to Reproduce:
1. Create a ganesha and kerberos setup.
2. Create a volume, export it via ganesha.
3. Edit the Sectype parameter as krb5 and try mounting the volume on the client
4. Observe that the kerberos mount fails with below message:

[root@dhcp42-130 ~]# mount -t nfs -o sec=krb5 dhcp42-142.lab.eng.blr.redhat.com:/testvolume /mnt
mount.nfs: access denied by server while mounting dhcp42-142.lab.eng.blr.redhat.com:/testvolume

and following AVC's are seen in audit.log (in enforcing mode):

type=AVC msg=audit(1465381707.050:4787): avc:  denied  { read } for  pid=12550 comm="ganesha.nfsd" name="krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=SYSCALL msg=audit(1465381707.050:4787): arch=c000003e syscall=2 success=no exit=-13 a0=7fbe0c183a80 a1=0 a2=1b6 a3=24 items=0 ppid=1 pid=12550 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1465381707.053:4788): avc:  denied  { read } for  pid=4911 comm="ganesha.nfsd" name="krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=SYSCALL msg=audit(1465381707.053:4788): arch=c000003e syscall=2 success=no exit=-13 a0=7fbe0c183a80 a1=0 a2=1b6 a3=24 items=0 ppid=1 pid=4911 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1465381707.055:4789): avc:  denied  { read } for  pid=12550 comm="ganesha.nfsd" name="krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=SYSCALL msg=audit(1465381707.055:4789): arch=c000003e syscall=2 success=no exit=-13 a0=7fbe0c183a80 a1=0 a2=1b6 a3=24 items=0 ppid=1 pid=12550 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1465381707.058:4790): avc:  denied  { read } for  pid=4911 comm="ganesha.nfsd" name="krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=SYSCALL msg=audit(1465381707.058:4790): arch=c000003e syscall=2 success=no exit=-13 a0=7fbe0c183a80 a1=0 a2=1b6 a3=24 items=0 ppid=1 pid=4911 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1465381707.070:4791): avc:  denied  { read } for  pid=12550 comm="ganesha.nfsd" name="krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=SYSCALL msg=audit(1465381707.070:4791): arch=c000003e syscall=2 success=no exit=-13 a0=7fbe0c183a80 a1=0 a2=1b6 a3=24 items=0 ppid=1 pid=12550 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1465381707.073:4792): avc:  denied  { read } for  pid=4911 comm="ganesha.nfsd" name="krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=SYSCALL msg=audit(1465381707.073:4792): arch=c000003e syscall=2 success=no exit=-13 a0=7fbe0c183a80 a1=0 a2=1b6 a3=24 items=0 ppid=1 pid=4911 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1465381708.252:4793): avc:  denied  { read } for  pid=4911 comm="ganesha.nfsd" name="krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file


In permissive mode the volume gets mounted without any issues but below AVC's are seen in audit.log

type=AVC msg=audit(1465382280.091:4826): avc:  denied  { read } for  pid=4911 comm="ganesha.nfsd" name="krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=AVC msg=audit(1465382280.091:4826): avc:  denied  { open } for  pid=4911 comm="ganesha.nfsd" path="/etc/krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=SYSCALL msg=audit(1465382280.091:4826): arch=c000003e syscall=2 success=yes exit=69 a0=7fbe0c183a80 a1=0 a2=1b6 a3=24 items=0 ppid=1 pid=4911 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1465382280.091:4827): avc:  denied  { lock } for  pid=4911 comm="ganesha.nfsd" path="/etc/krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=SYSCALL msg=audit(1465382280.091:4827): arch=c000003e syscall=72 success=yes exit=0 a0=45 a1=7 a2=7fbe1d0f08c0 a3=1 items=0 ppid=1 pid=4911 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1465382280.095:4828): avc:  denied  { setfscreate } for  pid=4911 comm="ganesha.nfsd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=process
type=SYSCALL msg=audit(1465382280.095:4828): arch=c000003e syscall=1 success=yes exit=40 a0=46 a1=7fbe0c2c7e40 a2=28 a3=636163725f74736f items=0 ppid=1 pid=4911 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)

type=AVC msg=audit(1465382439.611:4837): avc:  denied  { read } for  pid=4911 comm="ganesha.nfsd" name="krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=AVC msg=audit(1465382439.611:4837): avc:  denied  { open } for  pid=4911 comm="ganesha.nfsd" path="/etc/krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=SYSCALL msg=audit(1465382439.611:4837): arch=c000003e syscall=2 success=yes exit=75 a0=7fbe0c183a80 a1=0 a2=1b6 a3=24 items=0 ppid=1 pid=4911 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1465382439.611:4838): avc:  denied  { lock } for  pid=4911 comm="ganesha.nfsd" path="/etc/krb5.keytab" dev="dm-0" ino=34326612 scontext=system_u:system_r:glusterd_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file
type=SYSCALL msg=audit(1465382439.611:4838): arch=c000003e syscall=72 success=yes exit=0 a0=4b a1=7 a2=7fbe1d0f08c0 a3=1 items=0 ppid=1 pid=4911 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ganesha.nfsd" exe="/usr/bin/ganesha.nfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)

Actual results:

kerberos mount fails with selinux denials in audit logs.

Expected results:

There should not be any AVC denial messages and kerberos mount should be successful.

Additional info:

--- Additional comment from Red Hat Bugzilla Rules Engine on 2016-06-08 06:42:23 EDT ---

This bug is automatically being proposed for the current z-stream release of Red Hat Gluster Storage 3 by setting the release flag 'rhgs‑3.1.z' to '?'. 

If this bug should be proposed for a different release, please manually change the proposed release flag.

--- Additional comment from Shashank Raj on 2016-06-08 06:43:28 EDT ---

Since this will not allow volumes to be mounted using kerberos. raising a blocker flag.

Comment 4 Shashank Raj 2016-06-09 06:27:46 UTC
Without the workaround:

[root@dhcp42-142 ~]# rpm -qa|grep selinux
selinux-policy-targeted-3.13.1-60.el7_2.6.noarch
selinux-policy-3.13.1-60.el7_2.6.noarch

[root@dhcp42-142 ~]# getenforce
Enforcing

[root@dhcp42-130 ~]# mount -t nfs -o sec=krb5 dhcp42-142.lab.eng.blr.redhat.com:/testvolume /mnt
mount.nfs: access denied by server while mounting 
dhcp42-142.lab.eng.blr.redhat.com:/testvolume

[root@dhcp42-130 ~]# mount -t nfs -o sec=krb5i dhcp42-142.lab.eng.blr.redhat.com:/testvolume /mnt
mount.nfs: access denied by server while mounting dhcp42-142.lab.eng.blr.redhat.com:/testvolume

[root@dhcp42-130 ~]# mount -t nfs -o sec=krb5p dhcp42-142.lab.eng.blr.redhat.com:/testvolume /mnt
mount.nfs: access denied by server while mounting dhcp42-142.lab.eng.blr.redhat.com:/testvolume

With the workaround:

In enforcing mode:

mount is successful and no AVC's are seen

[root@dhcp42-130 ~]# mount -t nfs -o sec=krb5 dhcp42-142.lab.eng.blr.redhat.com:/testvolume /mnt
[root@dhcp42-130 ~]# mount -t nfs -o sec=krb5i dhcp42-142.lab.eng.blr.redhat.com:/testvolume /mnt
[root@dhcp42-130 ~]# mount -t nfs -o sec=krb5p dhcp42-142.lab.eng.blr.redhat.com:/testvolume /mnt

In permissive mode:

Mount is successful and no AVC's are seen

[root@dhcp42-130 ~]# mount -t nfs -o sec=krb5 dhcp42-142.lab.eng.blr.redhat.com:/testvolume /mnt
[root@dhcp42-130 ~]# mount -t nfs -o sec=krb5i dhcp42-142.lab.eng.blr.redhat.com:/testvolume /mnt
[root@dhcp42-130 ~]# mount -t nfs -o sec=krb5p dhcp42-142.lab.eng.blr.redhat.com:/testvolume /mnt

So the above workaround mentioned in comment 2 works fine; kerberos mount is successful and no AVC's are seen in audit.log

Comment 5 Lukas Vrabec 2016-06-09 10:12:12 UTC
Thank you for testing.

Comment 11 errata-xmlrpc 2016-11-04 02:30:57 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://rhn.redhat.com/errata/RHBA-2016-2283.html


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