Bug 506326 - selinux targeted policy puts vncserver in the wrong context
selinux targeted policy puts vncserver in the wrong context
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
11
All Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Ben Levenson
:
: 453716 551102 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-16 13:13 EDT by Danny Padwa
Modified: 2010-03-04 03:31 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-04 03:31:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Danny Padwa 2009-06-16 13:13:34 EDT
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 17:46:13 EDT
*** Bug 453716 has been marked as a duplicate of this bug. ***
Comment 2 Daniel Walsh 2009-07-09 08:36:39 EDT
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 11:04:16 EDT
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 18:40:41 EST
*** Bug 551102 has been marked as a duplicate of this bug. ***
Comment 5 Jón Fairbairn 2010-01-15 09:39:18 EST
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 03:31:44 EST
The fix was added to the F12 selinux-policy.

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