selinux/policycoreutils/mcstrans
Stephen Smalley dcc55dba56 mcstransd: don't reinvent getpeercon, badly.
libselinux provides a proper getpeercon() implementation that uses
getsockopt with SO_PEERSEC to reliably obtain the peer's security
context from the kernel.  mcstransd for reasons unknown rolled its
own get_peer_con() function that uses getsockopt SO_PEERCRED
to obtain the peer PID and then calls getpidcon_raw().  That's
less efficient and less secure (subject to races; peer context
may have changed since connect).  Don't do that.

The peer context doesn't appear to be used for anything currently,
although there is a comment suggesting adding a permission check to
see if the requester dominates the label to be translated to control
what labels can be translated by what peers.  Could likely dispense
with it altogether.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-05-14 13:03:29 -04:00
..
man Minor manpages improvements 2013-11-06 09:36:33 -05:00
share Add mcstrans to policycoreutils 2010-07-21 15:40:00 -04:00
src mcstransd: don't reinvent getpeercon, badly. 2015-05-14 13:03:29 -04:00
utils Add mcstrans to policycoreutils 2010-07-21 15:40:00 -04:00
ChangeLog Add mcstrans to policycoreutils 2010-07-21 15:40:00 -04:00
COPYING Add mcstrans to policycoreutils 2010-07-21 15:40:00 -04:00
Makefile Add mcstrans to policycoreutils 2010-07-21 15:40:00 -04:00
TODO Add mcstrans to policycoreutils 2010-07-21 15:40:00 -04:00
VERSION policycoreutils: mcstrans: Version should have been bumped on last check in 2012-03-28 14:52:13 -04:00