Bug 506326

Summary: selinux targeted policy puts vncserver in the wrong context
Product: [Fedora] Fedora Reporter: Danny Padwa <daniel.padwa>
Component: selinux-policy-targetedAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NEXTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: aph, daniel.padwa, jon.fairbairn, mcepl, mcepl, michael.moerman, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-04 08:31:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Danny Padwa 2009-06-16 17:13:34 UTC
Description of problem:
selinux targeted has the file context of /usr/bin/vncserver as system_u:object_r:unconfined_notrans_exec_t:s0.  This causes Xvnc to run in unconfined_notrans_t, which means that if you restart a service (eg sshd) from an xterm inside of Xvnc, it doesn't get the right context and cannot do its job.

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.6.12-39.fc11.noarch

How reproducible:
Consistently

Steps to Reproduce:
1. Run vncserver, make sure it starts an xterm
2. Connect to the child Xvnc process
3. Note that your shell process (in the xterm) is in unconfined_notrans_t instead of unconfined_t
4. Make sure you have a shell somewhere else in unconfined_t to ensure you don't lock yourself out of the machine (without a reboot)
5. sudo service sshd restart
6. Note that sshd was not able to switch to sshd_t, and is instead running in unconfined_notrans_t
7. Try to ssh in to the machine - sshd cannot spawn a user shell
  
Actual results:
Because sshd is running unconfined_notrans_t, it cannot spawn a user shell

Expected results:
sshd should be running in sshd_t, and should be able to spawn a user shell

Additional info:

Comment 1 Miroslav Grepl 2009-07-08 21:46:13 UTC
*** Bug 453716 has been marked as a duplicate of this bug. ***

Comment 2 Daniel Walsh 2009-07-09 12:36:39 UTC
Miroslav can you play around with this and see if you can get it running in unconfined_t.

Comment 3 Miroslav Grepl 2009-08-12 15:04:16 UTC
It seems like it works with unconfined_t. 


Danny, 

could you try execute

# chcon -t unconfined_exec_t /usr/bin/vncserver

And see if it works fine also for you.

Comment 4 Michael Moerman 2010-01-01 23:40:41 UTC
*** Bug 551102 has been marked as a duplicate of this bug. ***

Comment 5 Jón Fairbairn 2010-01-15 14:39:18 UTC
I was also having problems with vnc on a headless system and 

chcon -t unconfined_exec_t /usr/bin/vncserver

seems to have made them go away.

Comment 6 Miroslav Grepl 2010-03-04 08:31:44 UTC
The fix was added to the F12 selinux-policy.