Bug 818652 - selinux prevents spice client from connecting to RHEV
selinux prevents spice client from connecting to RHEV
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-05-03 12:18 EDT by Jason Montleon
Modified: 2012-05-08 00:22 EDT (History)
6 users (show)

See Also:
Fixed In Version: selinux-policy-3.10.0-121.fc17
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-05-08 00:22:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jason Montleon 2012-05-03 12:18:07 EDT
Description of problem:
When trying to launch a spice client session from the RHEV webadmin interface I get an error message that states: "Unable to connect to the graphic server"

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

How reproducible:

Steps to Reproduce:
1. Log in to a RHEV webadmin interface
2. Try to launch a vm's spice console
Actual results:
Error message pops up with the message" "Unable to connect to the graphic server"

Expected results:
spice client starts normally

Additional info:
The relevant AVC's:
type=AVC msg=audit(1336061298.706:1937): avc:  denied  { name_connect } for  pid=22592 comm="remote-viewer" dest=5900 scontext=unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c0.c1023 tcontext=system_u:object_r:vnc_port_t:s0 tclass=tcp_socket
type=AVC msg=audit(1336061298.710:1938): avc:  denied  { name_connect } for  pid=22592 comm="remote-viewer" dest=5901 scontext=unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c0.c1023 tcontext=system_u:object_r:vnc_port_t:s0 tclass=tcp_socket

which gives the following when run through audit2allow -m; installing this module causes things to work properly:

module spice-xpi 1.0;

require {
	type vnc_port_t;
	type mozilla_plugin_t;
	class tcp_socket name_connect;

#============= mozilla_plugin_t ==============
allow mozilla_plugin_t vnc_port_t:tcp_socket name_connect;
Comment 1 Marc-Andre Lureau 2012-05-03 12:40:54 EDT
Note that the port may vary, it's not always 59XX, it could be anything afaik.
Comment 2 Jason Montleon 2012-05-03 13:10:24 EDT
For RHEV at least the dest ports are known. RHEV uses the same range for spice and vnc.

5634 - 6166 	TCP 	
Administration Portal clients
User Portal clients 

Red Hat Enterprise Virtualization Hypervisor(s)
Red Hat Enterprise Linux host(s) 

Remote guest console access via VNC and Spice. These ports must be open to     
facilitate client access to virtual machines. 

Comment 3 Daniel Walsh 2012-05-04 09:11:58 EDT
# senetwork vnc_port_t
vnc_port_t: tcp: 5900-5983,5985-5999

If we allow mozilla_plugin_t to connect to vncports you would get all of the above.

# senetwork 5984
5984: tcp couchdb_port_t 5984

I will also give it couchdb
Comment 4 Daniel Walsh 2012-05-04 09:14:06 EDT
Fixed in selinux-policy-3.10.0-121.fc17
Comment 5 Fedora Update System 2012-05-04 15:53:18 EDT
selinux-policy-3.10.0-121.fc17 has been submitted as an update for Fedora 17.
Comment 6 Fedora Update System 2012-05-04 18:17:05 EDT
Package selinux-policy-3.10.0-121.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-121.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 7 Fedora Update System 2012-05-08 00:22:57 EDT
selinux-policy-3.10.0-121.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

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