Bug 627710 - SELinux is preventing /usr/sbin/acpid "read" access to device mouse1.
Summary: SELinux is preventing /usr/sbin/acpid "read" access to device mouse1.
Keywords:
Status: CLOSED DUPLICATE of bug 566332
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 14
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:0399a84e231...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-26 17:55 UTC by Joel
Modified: 2010-10-31 17:58 UTC (History)
14 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-08-30 23:01:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Joel 2010-08-26 17:55:01 UTC
Summary:

SELinux is preventing /usr/sbin/acpid "read" access to device mouse1.

Detailed Description:

[acpid has a permissive type (apmd_t). This access was not denied.]

SELinux has denied acpid "read" access to device mouse1. mouse1 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 'mouse1'. 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 mouse1, you can use chcon -t SIMILAR_TYPE
'mouse1', If this fixes the problem, you can make this permanent by executing
semanage fcontext -a -t SIMILAR_TYPE 'mouse1' 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 'mouse1' or chcon -t SIMILAR_TYPE 'mouse1'

Additional Information:

Source Context                system_u:system_r:apmd_t:s0
Target Context                system_u:object_r:device_t:s0
Target Objects                mouse1 [ chr_file ]
Source                        acpid
Source Path                   /usr/sbin/acpid
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           acpid-2.0.5-2.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.8.8-20.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   device
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.2-9.fc14.x86_64 #1 SMP Tue Aug
                              17 22:36:15 UTC 2010 x86_64 x86_64
Alert Count                   2
First Seen                    Thu 26 Aug 2010 01:54:27 PM EDT
Last Seen                     Thu 26 Aug 2010 01:54:27 PM EDT
Local ID                      b94c4975-f67c-4361-b624-34f69073ebe4
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1282845267.906:23297): avc:  denied  { read } for  pid=1194 comm="acpid" name="mouse1" dev=devtmpfs ino=212303 scontext=system_u:system_r:apmd_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=chr_file

node=(removed) type=AVC msg=audit(1282845267.906:23297): avc:  denied  { open } for  pid=1194 comm="acpid" name="mouse1" dev=devtmpfs ino=212303 scontext=system_u:system_r:apmd_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=chr_file

node=(removed) type=SYSCALL msg=audit(1282845267.906:23297): arch=c000003e syscall=2 success=yes exit=13 a0=7fff46db4bb0 a1=800 a2=7fff46db4b9f a3=3c items=0 ppid=1 pid=1194 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="acpid" exe="/usr/sbin/acpid" subj=system_u:system_r:apmd_t:s0 key=(null)



Hash String generated from  device,acpid,apmd_t,device_t,chr_file,read
audit2allow suggests:

#============= apmd_t ==============
allow apmd_t device_t:chr_file { read open };

Comment 1 Joel 2010-08-26 17:55:48 UTC
This SELinux alert pops up every time I plug in my USB mouse.

Comment 2 Daniel Walsh 2010-08-26 18:14:13 UTC
Can you execute 

# find /dev -name mouse1 -printf "%p %Z\n"
/dev/input/mouse1 system_u:object_r:mouse_device_t:s0

Does the mouse have the proper label on it?

Comment 3 Joel 2010-08-26 18:22:13 UTC
[root@f14x64 ~]# find /dev -name mouse1 -printf "%p %Z\n"
/dev/input/mouse1 system_u:object_r:mouse_device_t:s0

Comment 4 Daniel Walsh 2010-08-26 18:55:26 UTC
Eric, this looks like one of those race conditions where the kernel creates a device and udev fixes the label, but some confined app apmd_t sees it first.

Comment 5 Eric Paris 2010-08-27 23:28:51 UTC
Likely a dup of 566332

Opening upstream discussion of what I think the problem is:

http://marc.info/?l=linux-kernel&m=128295007600443&w=2

I think it's devtmpfs.

Comment 6 Eric Paris 2010-08-30 23:01:51 UTC

*** This bug has been marked as a duplicate of bug 566332 ***


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