Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 927003 - avc: denied { name_connect } for yppush when called from yppasswdd on NIS master
avc: denied { name_connect } for yppush when called from yppasswdd on NIS ma...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy (Show other bugs)
6.1
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
:
Depends On:
Blocks: 959171 1004834
  Show dependency treegraph
 
Reported: 2013-03-24 13:45 EDT by Andreas Luik
Modified: 2015-11-02 08:42 EST (History)
4 users (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-210.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 959171 1004834 (view as bug list)
Environment:
Last Closed: 2013-11-21 05:21:41 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1598 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2013-11-20 16:39:24 EST

  None (edit)
Description Andreas Luik 2013-03-24 13:45:59 EDT
Description of problem:

We run RHEL 6.1 on a NIS master with two other machines running as NIS slaves.
The NIS master runs "yppasswdd --port 836".  When a NIS client changes a NIS password, the updated password is written to the passwd file, yppasswdd calls "make" in /var/yp, the local passwd.byname and passwd.byuid databases are rebuilt, but they are not pushed to the NIS slaves.  Instead the following message is logged:

kernel: type=1400 audit(1363998232.751:20728): avc:  denied  { name_connect } for  pid=9739 comm="yppush" dest=111 scontext=system_u:system_r:yppasswdd_t:s0 tcontext=system_u:object_r:portmap_port_t:s0 tclass=tcp_socket

Obviously, yppush when called from yppasswdd is not allowed to connect to the rpcbind daemon.  I have been able to "fix" this with a local SElinux rule:

allow yppasswdd_t portmap_port_t:tcp_socket name_connect;

Unfortunately, it still does not work, another avc is logged:

kernel: type=1400 audit(1364055250.719:22259): avc:  denied  { name_connect } for  pid=11586 comm="yppush" dest=804 scontext=unconfined_u:system_r:yppasswdd_t:s0 tcontext=system_u:object_r:hi_reserved_port_t:s0 tclass=tcp_socket

With a second local SElinux rule, everything works:

allow yppasswdd_t hi_reserved_port_t:tcp_socket name_connect;

Please update selinux-policy to allow yppasswdd/yppush to push NIS maps to the slaves, either with the abovementioned allows or a different approach.


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

I have observed the problem with 3.7.19-93, but don't think it is fixed in the current -195.


How reproducible: always


Steps to Reproduce:
1. Set up NIS master server with at least one NIS slave, run yppasswdd daemon on NIS master.
2. Enable yppush in /var/yp/Makefile:
NOPUSH=false
3. On a NIS client, change the passwd of the user.
  
Actual results:

4. The new password is updated on the NIS master's passwd/shadow file and the database, but not on the slave server(s).  Observe abovementioned error message(s) on NIS master.

Expected results:

5. The password is also updated on the slaves, no avc error in log.

Additional info:
Comment 1 Miroslav Grepl 2013-03-25 08:44:29 EDT
# cat mypol.te
policy_module(mypol, 1.0)

require{
 type yppasswdd_t;
}

nis_use_ypbind(yppasswdd_t)


# make -f /usr/share/selinux/devel/Makefile mypol.pp
# semodule -i mypol.pp

will fix it for now.
Comment 8 errata-xmlrpc 2013-11-21 05:21:41 EST
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-2013-1598.html

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