Bug 742463 - SELinux is preventing modem-manager from 'getattr' accesses on the chr_file /dev/ttyUSB0.
Summary: SELinux is preventing modem-manager from 'getattr' accesses on the chr_file /...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: i386
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:9ee18059a9e...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-30 08:55 UTC by ramayu
Modified: 2011-10-03 08:44 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-03 08:44:15 UTC
Type: ---


Attachments (Terms of Use)

Description ramayu 2011-09-30 08:55:27 UTC
SELinux is preventing modem-manager from 'getattr' accesses on the chr_file /dev/ttyUSB0.

*****  Plugin restorecon (90.5 confidence) suggests  *************************

If you want to fix the label. 
/dev/ttyUSB0 default label should be tty_device_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /dev/ttyUSB0

*****  Plugin device (9.50 confidence) suggests  *****************************

If you want to allow modem-manager to have getattr access on the ttyUSB0 chr_file
Then you need to change the label on /dev/ttyUSB0 to a type of a similar device.
Do
# semanage fcontext -a -t SIMILAR_TYPE '/dev/ttyUSB0'
# restorecon -v '/dev/ttyUSB0'

*****  Plugin catchall (1.40 confidence) suggests  ***************************

If you believe that modem-manager should be allowed getattr access on the ttyUSB0 chr_file 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 modem-manager /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:modemmanager_t:s0-s0:c0.c1023
Target Context                system_u:object_r:device_t:s0
Target Objects                /dev/ttyUSB0 [ chr_file ]
Source                        modem-manager
Source Path                   modem-manager
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-38.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.40.4-5.fc15.i686
                              #1 SMP Tue Aug 30 14:54:41 UTC 2011 i686 i686
Alert Count                   30
First Seen                    Tue 27 Sep 2011 10:03:28 PM CIT
Last Seen                     Fri 30 Sep 2011 04:48:34 PM CIT
Local ID                      240441eb-9287-496e-b845-2eac8e13a982

Raw Audit Messages
type=AVC msg=audit(1317372514.387:94): avc:  denied  { getattr } for  pid=749 comm="modem-manager" path="/dev/ttyUSB0" dev=devtmpfs ino=42401 scontext=system_u:system_r:modemmanager_t:s0-s0:c0.c1023 tcontext=system_u:object_r:device_t:s0 tclass=chr_file


Hash: modem-manager,modemmanager_t,device_t,chr_file,getattr

audit2allow

#============= modemmanager_t ==============
allow modemmanager_t device_t:chr_file getattr;

audit2allow -R

#============= modemmanager_t ==============
allow modemmanager_t device_t:chr_file getattr;

Comment 1 Miroslav Grepl 2011-09-30 09:05:47 UTC
How is labeled /dev/ttyUSB0 now

# ls -Z /dev/ttyUSB0


I guess the label will be ok and you can dontaudit it. This kind of errors should go away with F16.

Comment 2 Miroslav Grepl 2011-10-03 08:44:15 UTC
You can dontaudit it using

# grep modem-manager /var/log/audit/audit.log | audit2allow -D -M mypol
# semodule -i mypol.pp

Please reopen the bug if you add needed information. Thank you.


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