Bug 564456 - SELinux is preventing /usr/bin/Xorg "read write" access to device /dev/nvidiactl.
Summary: SELinux is preventing /usr/bin/Xorg "read write" access to device /dev/nvidia...
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 12
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:c39c73e5499...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-12 19:51 UTC by giorgos
Modified: 2010-02-13 13:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-02-13 13:02:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description giorgos 2010-02-12 19:51:24 UTC
Summary:

SELinux is preventing /usr/bin/Xorg "read write" access to device
/dev/nvidiactl.

Detailed Description:

[SELinux is in permissive mode. This access was not denied.]

SELinux has denied Xorg "read write" access to device /dev/nvidiactl.
/dev/nvidiactl is mislabeled, this device has the default label of the /dev
directory, which should not happen. All Character and/or Block Devices should
have a label. You can attempt to change the label of the file using restorecon
-v '/dev/nvidiactl'. If this device remains labeled device_t, then this is a bug
in SELinux policy. Please file a bg report. If you look at the other similar
devices labels, ls -lZ /dev/SIMILAR, and find a type that would work for
/dev/nvidiactl, you can use chcon -t SIMILAR_TYPE '/dev/nvidiactl', If this
fixes the problem, you can make this permanent by executing semanage fcontext -a
-t SIMILAR_TYPE '/dev/nvidiactl' If the restorecon changes the context, this
indicates that the application that created the device, created it without using
SELinux APIs. If you can figure out which application created the device, please
file a bug report against this application.

Allowing Access:

Attempt restorecon -v '/dev/nvidiactl' or chcon -t SIMILAR_TYPE '/dev/nvidiactl'

Additional Information:

Source Context                system_u:system_r:xserver_t:s0-s0:c0.c1023
Target Context                system_u:object_r:device_t:s0
Target Objects                /dev/nvidiactl [ chr_file ]
Source                        Xorg
Source Path                   /usr/bin/Xorg
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           xorg-x11-server-Xorg-1.7.4-1.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-84.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Plugin Name                   device
Host Name                     (removed)
Platform                      Linux (removed) 2.6.31.12-174.2.3.fc12.x86_64 #1 SMP
                              Mon Jan 18 19:52:07 UTC 2010 x86_64 x86_64
Alert Count                   53
First Seen                    Fri 12 Feb 2010 12:27:42 PM EET
Last Seen                     Fri 12 Feb 2010 09:49:25 PM EET
Local ID                      257fd1df-f45f-4f73-8b4e-1b095a943f03
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1266004165.473:269): avc:  denied  { read write } for  pid=1503 comm="Xorg" path="/dev/nvidiactl" dev=tmpfs ino=12365 scontext=system_u:system_r:xserver_t:s0-s0:c0.c1023 tcontext=system_u:object_r:device_t:s0 tclass=chr_file

node=(removed) type=SYSCALL msg=audit(1266004165.473:269): arch=c000003e syscall=16 success=yes exit=4194432 a0=9 a1=c020462a a2=7fff4a136900 a3=1 items=0 ppid=1502 pid=1503 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty1 ses=4294967295 comm="Xorg" exe="/usr/bin/Xorg" subj=system_u:system_r:xserver_t:s0-s0:c0.c1023 key=(null)



Hash String generated from  selinux-policy-3.6.32-84.fc12,device,Xorg,xserver_t,device_t,chr_file,read,write
audit2allow suggests:

#============= xserver_t ==============
allow xserver_t device_t:chr_file { read write };

Comment 1 Daniel Walsh 2010-02-13 13:02:38 UTC
For some reason this device got created with the wrong label.

restorecon /dev/nvidiactl

Will fix.  Probably something broken in nvidea module that creates the device rather then having udev create the device.

matchpathcon /dev/nvidiactl
/dev/nvidiactl	system_u:object_r:xserver_misc_device_t:s0

If you figure out where this device is created you can add restorcon /dev/nvidiactl right after it gets created,

Or you can add a local policy modification to allow the access

# grep xserver_t /var/log/audit/audit.log | audit2allow -M nvidiaisbroken
# semodule -i nvidiaisbroken.pp


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