Bug 757345

Summary: selinux targeted policy is blocking spice-vdagent
Product: [Fedora] Fedora Reporter: bodhi.zazen <bodhi.zazen>
Component: selinux-policy-targetedAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dwalsh, hdegoede
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: selinux-policy-3.10.0-64.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 01:05:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description bodhi.zazen 2011-11-26 15:10:42 UTC
Description of problem: 

selinux targeted policy is blocking spice-vdagent with confined users


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


How reproducible:

Always

Confine your users (as staff_u or user_u )


Steps to Reproduce:
1. Confine your users (as staff_u or user_u )
2. Login (start spice-vdagent)
3.
  
Actual results:

Spice vdagent does not start


Expected results:

spice vdagent starts

Additional info:

AVC denial
type=AVC msg=audit(1322278140.911:69): avc:  denied  { read } for  pid=2562 comm="spice-vdagentd" name="ld.so.cache" dev=dm-1 ino=136265 scontext=system_u:system_r:vdagent_t:s0 tcontext=staff_u:object_r:ld_so_cache_t:s0:c0.c256 tclass=file

	Was caused by:
		Policy constraint violation.

		May require adding a type attribute to the domain or type to satisfy the constraint.

		Constraints are defined in the policy sources in policy/constraints (general), policy/mcs (MCS), and policy/mls (MLS).


I do not know how to write a local policy for this constraint violation and am no further along despite a google search.

Comment 1 bodhi.zazen 2011-11-28 04:00:42 UTC
This seems to be somewhat similar to this previous bug:

https://bugzilla.redhat.com/show_bug.cgi?id=648553

I am not, however, getting any additional AVC denials, even if I put selinux into permissive mode or if I look for silent denials with semodule -DB

With selinux in enforcing mode I get:

spice-vdagent -x
Missing virtio device: /dev/virtio-ports/com.redhat.spice.0

With selinux in permissive mode , spice-vdagent works.

Spice vdagent works for unconfined users, but not gdm.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 2 Miroslav Grepl 2011-11-28 11:59:05 UTC
Are you playing with MCS?

Hans,
is /dev/virtio-ports/com.redhat.spice.0 something new?

Comment 3 Hans de Goede 2011-11-28 12:39:09 UTC
(In reply to comment #2)
> Hans,
> is /dev/virtio-ports/com.redhat.spice.0 something new?

For the per user session agent process, yes, see:
https://bugzilla.redhat.com/show_bug.cgi?id=737790#c12

Comment 4 Miroslav Grepl 2011-11-28 13:51:52 UTC
Ah, I missed 

"/dev/virtio-ports/com.redhat.spice.0 (which is a symlink to a
/dev/vport#p#)"

Comment 5 bodhi.zazen 2011-11-28 16:46:06 UTC
@Miroslav Grepl and Hans de Goede - thank you both for looking at this problem. 

I was using MCS for a while, but I have removed it now and spice-vdagent behaves the same with a fresh install - not working with confined users.

Comment 6 Daniel Walsh 2011-12-01 21:23:39 UTC
Miroslav we figured out he needed

term_use_virtio_console(staff_t)

Can you add this to userdom.if 

In RHEL6, F15, F16.

Comment 7 bodhi.zazen 2011-12-01 21:30:57 UTC
"we" is a HUGE stretch, thank you for your assistance, as always, Daniel

user_u also please =)

Comment 8 Miroslav Grepl 2011-12-02 08:55:58 UTC
Added.

Comment 9 Fedora Update System 2011-12-02 13:15:50 UTC
selinux-policy-3.10.0-64.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-64.fc16

Comment 10 Fedora Update System 2011-12-04 02:31:52 UTC
Package selinux-policy-3.10.0-64.fc16:
* should fix your issue,
* was pushed to the Fedora 16 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-64.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-16698/selinux-policy-3.10.0-64.fc16
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2011-12-06 01:05:35 UTC
selinux-policy-3.10.0-64.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.