Bug 679105

Summary: SELinux is preventing /sbin/usbhid-ups from 'read' accesses on the directory devices.
Product: [Fedora] Fedora Reporter: Michal Hlavinka <mhlavink>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: dwalsh, mgrepl
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:15f5df7e59c7fef5be7a773ca1203a68546ec43b4061bb2c309d0cdc4f2968e8
Fixed In Version: selinux-policy-3.9.15-2.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-08 02:20:21 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 Michal Hlavinka 2011-02-21 15:50:32 UTC
SELinux is preventing /sbin/usbhid-ups from 'read' accesses on the directory devices.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that usbhid-ups should be allowed read access on the devices directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep usbhid-ups /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:nut_upsdrvctl_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                devices [ dir ]
Source                        usbhid-ups
Source Path                   /sbin/usbhid-ups
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           nut-2.6.0-2.fc16
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.14-2.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.38-0.rc5.git5.1.fc15.x86_64 #1 SMP Sun Feb 20
                              04:29:44 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Mon 21 Feb 2011 04:49:11 PM CET
Last Seen                     Mon 21 Feb 2011 04:49:11 PM CET
Local ID                      54c98473-0755-4b31-8c22-96e6e16be566

Raw Audit Messages
type=AVC msg=audit(1298303351.213:116): avc:  denied  { read } for  pid=8144 comm="usbhid-ups" name="devices" dev=sysfs ino=3635 scontext=system_u:system_r:nut_upsdrvctl_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir


type=SYSCALL msg=audit(1298303351.213:116): arch=x86_64 syscall=open success=no exit=EACCES a0=340d80a490 a1=90800 a2=33f8b981e0 a3=7fff8d2e8300 items=0 ppid=8143 pid=8144 auid=4294967295 uid=57 gid=57 euid=57 suid=57 fsuid=57 egid=57 sgid=57 fsgid=57 tty=(none) ses=4294967295 comm=usbhid-ups exe=/sbin/usbhid-ups subj=system_u:system_r:nut_upsdrvctl_t:s0 key=(null)

Hash: usbhid-ups,nut_upsdrvctl_t,sysfs_t,dir,read

audit2allow

#============= nut_upsdrvctl_t ==============
allow nut_upsdrvctl_t sysfs_t:dir read;

audit2allow -R

#============= nut_upsdrvctl_t ==============
allow nut_upsdrvctl_t sysfs_t:dir read;

Comment 1 Michal Hlavinka 2011-02-21 15:54:11 UTC
and continues with:

Source Context                system_u:system_r:nut_upsdrvctl_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                usb1 [ lnk_file ]
Source                        usbhid-ups

Raw Audit Messages
type=AVC msg=audit(1298303485.857:122): avc:  denied  { read } for  pid=8305 comm="usbhid-ups" name="usb1" dev=sysfs ino=14667 scontext=system_u:system_r:nut_upsdrvctl_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=lnk_file


type=AVC msg=audit(1298303485.857:122): avc:  denied  { getattr } for  pid=8305 comm="usbhid-ups" path="/sys/devices/pci0000:00/0000:00:1d.7/usb1/descriptors" dev=sysfs ino=14687 scontext=system_u:system_r:nut_upsdrvctl_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file


type=SYSCALL msg=audit(1298303485.857:122): arch=x86_64 syscall=stat success=yes exit=0 a0=7ffff3471600 a1=7ffff3471560 a2=7ffff3471560 a3=7ffff34712d0 items=0 ppid=8304 pid=8305 auid=4294967295 uid=57 gid=57 euid=57 suid=57 fsuid=57 egid=57 sgid=57 fsgid=57 tty=(none) ses=4294967295 comm=usbhid-ups exe=/sbin/usbhid-ups subj=system_u:system_r:nut_upsdrvctl_t:s0 key=(null)


#============= nut_upsdrvctl_t ==============
allow nut_upsdrvctl_t sysfs_t:file getattr;
allow nut_upsdrvctl_t sysfs_t:lnk_file read;
---------------------------------------------------------------
and:
Source Context                system_u:system_r:nut_upsdrvctl_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                busnum [ file ]
Source                        usbhid-ups

Raw Audit Messages
type=AVC msg=audit(1298303485.857:123): avc:  denied  { read } for  pid=8305 comm="usbhid-ups" name="busnum" dev=sysfs ino=14655 scontext=system_u:system_r:nut_upsdrvctl_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file


type=AVC msg=audit(1298303485.857:123): avc:  denied  { open } for  pid=8305 comm="usbhid-ups" name="busnum" dev=sysfs ino=14655 scontext=system_u:system_r:nut_upsdrvctl_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file


type=SYSCALL msg=audit(1298303485.857:123): arch=x86_64 syscall=open success=yes exit=ENOEXEC a0=7ffff3471600 a1=0 a2=1b6 a3=7ffff34712d0 items=0 ppid=8304 pid=8305 auid=4294967295 uid=57 gid=57 euid=57 suid=57 fsuid=57 egid=57 sgid=57 fsgid=57 tty=(none) ses=4294967295 comm=usbhid-ups exe=/sbin/usbhid-ups subj=system_u:system_r:nut_upsdrvctl_t:s0 key=(null)


#============= nut_upsdrvctl_t ==============
allow nut_upsdrvctl_t sysfs_t:file { read open };

Comment 2 Miroslav Grepl 2011-02-21 16:13:41 UTC
Fixed in the next rawhide/F15 release.

Comment 3 Fedora Update System 2011-02-21 20:44:46 UTC
selinux-policy-3.9.15-2.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.15-2.fc15

Comment 4 Fedora Update System 2011-02-22 21:49:08 UTC
selinux-policy-3.9.15-2.fc15 has been pushed to the Fedora 15 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/selinux-policy-3.9.15-2.fc15

Comment 5 Fedora Update System 2011-03-08 02:20:04 UTC
selinux-policy-3.9.15-2.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.