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 1426554

Summary: nfs-ganesha triggers SELinux denials when running as ganesha_t
Product: Red Hat Enterprise Linux 7 Reporter: Milos Malik <mmalik>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: high Docs Contact:
Priority: high    
Version: 7.4CC: lvrabec, mgrepl, mmalik, plautrba, pvrabec, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.13.1-130.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 15:22:43 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 Milos Malik 2017-02-24 09:43:18 UTC
Description of problem:

Version-Release number of selected component (if applicable):
nfs-ganesha-2.3.2-1.el7.x86_64
selinux-policy-3.13.1-123.el7.noarch
selinux-policy-devel-3.13.1-123.el7.noarch
selinux-policy-minimum-3.13.1-123.el7.noarch
selinux-policy-mls-3.13.1-123.el7.noarch
selinux-policy-targeted-3.13.1-123.el7.noarch

How reproducible:
* always

Steps to Reproduce:
0. get a RHEL-7.4 machine (targeted policy is active)
# touch /etc/krb5.keytab
# service nfs-ganesha start
# service nfs-ganesha status
# service nfs-ganesha stop
# ausearch -m avc -m user_avc -m selinux_err -m user_selinux_err -i -ts recent

Actual results (enforcing mode):
----
type=SOCKADDR msg=audit(02/24/2017 10:29:32.315:425) : saddr={ fam=inet6 laddr=:: lport=20048 } 
type=SYSCALL msg=audit(02/24/2017 10:29:32.315:425) : arch=x86_64 syscall=bind success=yes exit=0 a0=0x16 a1=0x7fc8e43e78a8 a2=0x1c a3=0x7ffdf3e7928c items=0 ppid=1 pid=23939 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=ganesha.nfsd exe=/usr/bin/ganesha.nfsd subj=system_u:system_r:ganesha_t:s0 key=(null) 
type=AVC msg=audit(02/24/2017 10:29:32.315:425) : avc:  denied  { name_bind } for  pid=23939 comm=ganesha.nfsd src=20048 scontext=system_u:system_r:ganesha_t:s0 tcontext=system_u:object_r:mountd_port_t:s0 tclass=udp_socket 
----
type=SOCKADDR msg=audit(02/24/2017 10:29:32.316:426) : saddr={ fam=inet6 laddr=:: lport=20048 } 
type=SYSCALL msg=audit(02/24/2017 10:29:32.316:426) : arch=x86_64 syscall=bind success=yes exit=0 a0=0x17 a1=0x7fc8e43e78c4 a2=0x1c a3=0x7ffdf3e7928c items=0 ppid=1 pid=23939 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=ganesha.nfsd exe=/usr/bin/ganesha.nfsd subj=system_u:system_r:ganesha_t:s0 key=(null) 
type=AVC msg=audit(02/24/2017 10:29:32.316:426) : avc:  denied  { name_bind } for  pid=23939 comm=ganesha.nfsd src=20048 scontext=system_u:system_r:ganesha_t:s0 tcontext=system_u:object_r:mountd_port_t:s0 tclass=tcp_socket 
----
type=PROCTITLE msg=audit(02/24/2017 10:33:16.525:191) : proctitle=/usr/bin/ganesha.nfsd -L /var/log/ganesha.log -f /etc/ganesha/ganesha.conf -N NIV_EVENT 
type=PATH msg=audit(02/24/2017 10:33:16.525:191) : item=0 name=/etc/krb5.keytab inode=8747721 dev=fd:02 mode=file,644 ouid=root ogid=root rdev=00:00 obj=unconfined_u:object_r:krb5_keytab_t:s0 nametype=NORMAL 
type=CWD msg=audit(02/24/2017 10:33:16.525:191) : cwd=/ 
type=SYSCALL msg=audit(02/24/2017 10:33:16.525:191) : arch=x86_64 syscall=open success=yes exit=28 a0=0x7f6e00c10980 a1=O_RDONLY a2=0x1b6 a3=0x7ffd5ed899a0 items=1 ppid=1 pid=9368 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=ganesha.nfsd exe=/usr/bin/ganesha.nfsd subj=system_u:system_r:ganesha_t:s0 key=(null) 
type=AVC msg=audit(02/24/2017 10:33:16.525:191) : avc:  denied  { open } for  pid=9368 comm=ganesha.nfsd path=/etc/krb5.keytab dev="vda2" ino=8747721 scontext=system_u:system_r:ganesha_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file permissive=1 
type=AVC msg=audit(02/24/2017 10:33:16.525:191) : avc:  denied  { read } for  pid=9368 comm=ganesha.nfsd name=krb5.keytab dev="vda2" ino=8747721 scontext=system_u:system_r:ganesha_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file permissive=1 
----
type=PROCTITLE msg=audit(02/24/2017 10:33:16.525:192) : proctitle=/usr/bin/ganesha.nfsd -L /var/log/ganesha.log -f /etc/ganesha/ganesha.conf -N NIV_EVENT 
type=SYSCALL msg=audit(02/24/2017 10:33:16.525:192) : arch=x86_64 syscall=fcntl success=yes exit=0 a0=0x1c a1=F_SETLKW a2=0x7ffd5ed89bc0 a3=0x7ffd5ed899a0 items=0 ppid=1 pid=9368 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=ganesha.nfsd exe=/usr/bin/ganesha.nfsd subj=system_u:system_r:ganesha_t:s0 key=(null) 
type=AVC msg=audit(02/24/2017 10:33:16.525:192) : avc:  denied  { lock } for  pid=9368 comm=ganesha.nfsd path=/etc/krb5.keytab dev="vda2" ino=8747721 scontext=system_u:system_r:ganesha_t:s0 tcontext=unconfined_u:object_r:krb5_keytab_t:s0 tclass=file permissive=1 
----

Expected results:
* no SELinux denials

Comment 1 Milos Malik 2017-02-24 10:39:42 UTC
Following USER_AVC appears when dbus introspection of ganesha is done from command line:
----
type=USER_AVC msg=audit(02/24/2017 11:34:19.425:672) : pid=534 uid=dbus auid=unset ses=unset subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { send_msg } for msgtype=method_return dest=:1.219 spid=8879 tpid=9336 scontext=system_u:system_r:ganesha_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=dbus  exe=/usr/bin/dbus-daemon sauid=dbus hostname=? addr=? terminal=?' 
----

Comment 2 Lukas Vrabec 2017-02-27 09:39:05 UTC
Milos,
Could you test it in permissive mode? 

Thanks.

Comment 3 Milos Malik 2017-02-27 10:21:48 UTC
The lists of SELinux denials from enforcing mode and from permissive mode are the same, because ganesha_t is defined as permissive domain.

Comment 4 Lukas Vrabec 2017-02-27 11:03:47 UTC
ou, yes of course. You are right.

Comment 10 errata-xmlrpc 2017-08-01 15:22:43 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-2017:1861