Bug 1004355

Summary: git-daemon runs as init_t when git.socket is active
Product: Red Hat Enterprise Linux 7 Reporter: Milos Malik <mmalik>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: mgrepl
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.12.1-77.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:56:18 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:
Bug Depends On:    
Bug Blocks: 1004161    

Description Milos Malik 2013-09-04 13:11:25 UTC
Description of problem:

Version-Release number of selected component (if applicable):
selinux-policy-3.12.1-73.el7.noarch
selinux-policy-devel-3.12.1-73.el7.noarch
selinux-policy-doc-3.12.1-73.el7.noarch
selinux-policy-minimum-3.12.1-73.el7.noarch
selinux-policy-mls-3.12.1-73.el7.noarch
selinux-policy-targeted-3.12.1-73.el7.noarch
git-daemon-1.8.3.1-2.el7.x86_64
git-1.8.3.1-2.el7.x86_64

How reproducible:
always

Steps to Reproduce:
# cp /usr/lib/systemd/system/git.service /usr/lib/systemd/system/git\@.service
# systemctl daemon-reload
# systemctl enable git.socket
ln -s '/usr/lib/systemd/system/git.socket' '/etc/systemd/system/sockets.target.wants/git.socket'
# systemctl start git.socket
# systemctl status git.socket
git.socket - Git Activation Socket
   Loaded: loaded (/usr/lib/systemd/system/git.socket; enabled)
   Active: active (listening) since Wed 2013-09-04 14:51:55 CEST; 5min ago
   Listen: [::]:9418 (Stream)
 Accepted: 7; Connected: 0

Sep 04 14:51:55 rhel70 systemd[1]: Listening on Git Activation Socket.
Sep 04 14:56:53 rhel70 systemd[1]: Listening on Git Activation Socket.
# nc -v 127.0.0.1 9418
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to 127.0.0.1:9418.
^Z
[1]+  Stopped                 nc -v 127.0.0.1 9418
# ps -efZ | grep git
system_u:system_r:init_t:s0     nobody   26573     1  0 14:57 ?        00:00:00 /usr/libexec/git-core/git-daemon --base-path=/var/lib/git --export-all --user-path=public_git --syslog --inetd --verbose
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 root 26575 23538  0 14:57 pts/0 00:00:00 grep --color=auto git
# fg
nc -v 127.0.0.1 9418
^C
#

Actual results:
 * git-daemon process is not labelled correctly

Expected results:
 * git-daemon process is labelled correctly

Comment 1 Milos Malik 2013-09-04 13:13:24 UTC
The executable is labelled correctly.

# ls -Z /usr/libexec/git-core/git-daemon 
-rwxr-xr-x. root root system_u:object_r:gitd_exec_t:s0 /usr/libexec/git-core/git-daemon
# matchpathcon /usr/libexec/git-core/git-daemon 
/usr/libexec/git-core/git-daemon	system_u:object_r:gitd_exec_t:s0
#

Comment 4 Ludek Smid 2014-06-13 11:56:18 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.