Bug 680612
Summary: | SELinux is preventing /lib/udev/udev-configure-printer from 'read' accesses on the chr_file 013. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dave Galloway <davematel> |
Component: | selinux-policy | Assignee: | Miroslav Grepl <mgrepl> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 15 | CC: | davematel, dwalsh, hansecke, jjbengi, marbolangos, mgrepl, milos.bugzilla |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | setroubleshoot_trace_hash:b3b6433f66320a9b29c4b76789cc19e6855f44e050f40ec1c9b652463fcb226a | ||
Fixed In Version: | selinux-policy-3.9.16-26.fc15 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-06-03 05:29:44 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Dave Galloway
2011-02-26 12:04:18 UTC
*** Bug 680646 has been marked as a duplicate of this bug. *** Is a device still mislabeled? # ls -Z /dev/013 Should have the following label # matchpathcon /dev/013 /dev/013 system_u:object_r:usb_device_t:s0 Dave, are you using software from a third party printer? The same thing happens to me when I plug in a USB printer. No 3rd-party printer software. There is no file /dev/013 Hans, what AVC are you getting? This is a race condition between the kernel creating the device, cups reading it and udev fixing the label. Dave and/or Hans, did the printer work fine? IE Was the only thing you knew about the AVC popping up? Miroslav: I'll attempt to reproduce tomorrow evening after a fresh reboot. Just unplugging and plugging the printer did not reproduce it. Daniel: Yes, it worked just fine. Miroslav lets add the dontaudit. dontaudit domain device_t:chr_file { read open }; I am testing it on my F15 where I have similar problem and looks good. You seem to have this covered (Thank you!), I'll hold off on trying to get more AVC info unless a direct request. I'd rather not reboot my home server..... Actually, I just repluged the printer and got the below. Don't know if its the same bug, but the chr_file stuff looks similar. Please tell me if I should file this as a different bug. SELinux is preventing /usr/bin/python from 'read, write' accesses on the chr_file 012. ***** Plugin device (91.4 confidence) suggests ***************************** If you want to allow python to have read write access on the 012 chr_file Then you need to change the label on 012 to a type of a similar device. Do # semanage fcontext -a -t SIMILAR_TYPE '012' # restorecon -v '012' ***** Plugin catchall (9.59 confidence) suggests *************************** If you believe that python should be allowed read write access on the 012 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 hpfax /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.pp Additional Information: Source Context system_u:system_r:hplip_t:s0-s0:c0.c1023 Target Context system_u:object_r:device_t:s0 Target Objects 012 [ chr_file ] Source hpfax Source Path /usr/bin/python Port <Unknown> Host localhost.localdomain Source RPM Packages python-2.7-8.fc14.1 Target RPM Packages Policy RPM selinux-policy-3.9.7-40.fc14 Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name localhost.localdomain Platform Linux localhost.localdomain 2.6.35.12-90.fc14.i686 #1 SMP Fri Apr 22 16:14:44 UTC 2011 i686 i686 Alert Count 1 First Seen Wed 18 May 2011 09:55:49 AM MDT Last Seen Wed 18 May 2011 09:55:49 AM MDT Local ID 7c38cd6e-9f59-4a61-a753-061dc268da16 Raw Audit Messages type=AVC msg=audit(1305734149.294:3900): avc: denied { read write } for pid=24979 comm="hpfax" name="012" dev=devtmpfs ino=4494346 scontext=system_u:system_r:hplip_t:s0-s0:c0.c1023 tcontext=system_u:object_r:device_t:s0 tclass=chr_file type=SYSCALL msg=audit(1305734149.294:3900): arch=i386 syscall=open success=no exit=EACCES a0=bfc01590 a1=2 a2=1 a3=992ce10 items=0 ppid=24978 pid=24979 auid=4294967295 uid=0 gid=7 euid=0 suid=0 fsuid=0 egid=7 sgid=7 fsgid=7 tty=(none) ses=4294967295 comm=hpfax exe=/usr/bin/python subj=system_u:system_r:hplip_t:s0-s0:c0.c1023 key=(null) Hash: hpfax,hplip_t,device_t,chr_file,read,write audit2allow #============= hplip_t ============== allow hplip_t device_t:chr_file { read write }; audit2allow -R #============= hplip_t ============== allow hplip_t device_t:chr_file { read write }; Here's another one. I just repluged the printer and got the below. Don't know if its the same bug, but the chr_file stuff looks similar. Please tell me if I should file this as a different bug. SELinux is preventing /usr/bin/python from open access on the chr_file 027. ***** Plugin device (91.4 confidence) suggests ***************************** If you want to allow python to have open access on the 027 chr_file Then you need to change the label on 027 to a type of a similar device. Do # semanage fcontext -a -t SIMILAR_TYPE '027' # restorecon -v '027' ***** Plugin catchall (9.59 confidence) suggests *************************** If you believe that python should be allowed open access on the 027 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 hpfax /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.pp Additional Information: Source Context system_u:system_r:hplip_t:s0-s0:c0.c1023 Target Context system_u:object_r:device_t:s0 Target Objects 027 [ chr_file ] Source hpfax Source Path /usr/bin/python Port <Unknown> Host localhost.localdomain Source RPM Packages python-2.7-8.fc14.1 Target RPM Packages Policy RPM selinux-policy-3.9.7-40.fc14 Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name localhost.localdomain Platform Linux localhost.localdomain 2.6.35.12-90.fc14.i686 #1 SMP Fri Apr 22 16:14:44 UTC 2011 i686 i686 Alert Count 2 First Seen Thu 19 May 2011 10:38:09 AM MDT Last Seen Thu 19 May 2011 10:38:09 AM MDT Local ID 07b7dbcd-0f4f-467d-bcd3-db38a12616b2 Raw Audit Messages type=AVC msg=audit(1305823089.525:4132): avc: denied { open } for pid=4203 comm="hpfax" name="027" dev=devtmpfs ino=4695524 scontext=system_u:system_r:hplip_t:s0-s0:c0.c1023 tcontext=system_u:object_r:device_t:s0 tclass=chr_file type=SYSCALL msg=audit(1305823089.525:4132): arch=i386 syscall=open success=no exit=EACCES a0=bfd79550 a1=0 a2=1 a3=91f8e80 items=0 ppid=4202 pid=4203 auid=4294967295 uid=0 gid=7 euid=0 suid=0 fsuid=0 egid=7 sgid=7 fsgid=7 tty=(none) ses=4294967295 comm=hpfax exe=/usr/bin/python subj=system_u:system_r:hplip_t:s0-s0:c0.c1023 key=(null) Hash: hpfax,hplip_t,device_t,chr_file,open audit2allow #============= hplip_t ============== #!!!! This avc is allowed in the current policy allow hplip_t device_t:chr_file open; audit2allow -R #============= hplip_t ============== #!!!! This avc is allowed in the current policy allow hplip_t device_t:chr_file open; Miroslav lets add dontaudit hplip_t device_t:chr_file { read open }; You guys rock. I appreciate the fast response and fix. Fixed in selinux-policy-3.9.16-25.fc15. selinux-policy-3.9.16-26.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-26.fc15 Package selinux-policy-3.9.16-26.fc15: * should fix your issue, * was pushed to the Fedora 15 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.9.16-26.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-26.fc15 then log in and leave karma (feedback). selinux-policy-3.9.16-26.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report. |