Bug 479713 - SELinux denial when plugging in a USB Floppy drive
SELinux denial when plugging in a USB Floppy drive
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-01-12 11:39 EST by Mark Watts
Modified: 2009-05-01 08:46 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-05-01 08:46:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mark Watts 2009-01-12 11:39:27 EST
Description of problem:

SELinux denial when plugging in a USB Floppy drive

Version-Release number of selected component (if applicable):

Fedora 10 

How reproducible:

Steps to Reproduce:
1. Plug USB Floppy drive in
Actual results:

Unable to use Floppy drive (/dev/sdb because its USB).
Specifically, unable to use the floppy drive in VirtualBox due to a permission-denied error.

SELinux Denial:

node=foo.example.com type=AVC msg=audit(1231776458.106:22): avc:  denied  { getattr } for  pid=4489 comm="setfacl" path="/dev/sdb" dev=tmpfs ino=19716 scontext=system_u:system_r:hald_acl_t:s0 tcontext=system_u:object_r:fixed_disk_device_t:s0 tclass=blk_file

node=foo.example.com type=SYSCALL msg=audit(1231776458.106:22): arch=40000003 syscall=196 success=no exit=-13 a0=bfb97828 a1=bfb97758 a2=b98ff4 a3=1 items=0 ppid=4487 pid=4489 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="setfacl" exe="/usr/bin/setfacl" subj=system_u:system_r:hald_acl_t:s0 key=(null)

Expected results:

No Denial and able to use/mount floppy disks via USB floppy drive.

Additional info:

This problem persists regardless of whether I have a floppy disk (1.44MB) inserted when I plug the device in or not.

I tried running  restorecon -v '/dev/sdb'  as suggested - this appears to have no effect:

[root@foo ~]# ls -laZ /dev/sdb
brw-rw----  root disk system_u:object_r:fixed_disk_device_t:s0 /dev/sdb
[root@foo ~]# restorecon -v '/dev/sdb'
[root@foo ~]# ls -laZ /dev/sdb
brw-rw----  root disk system_u:object_r:fixed_disk_device_t:s0 /dev/sdb

I also tried following the instructions at http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385 (as listed in the AVC Denial message):

[root@foo ~]# audit2allow -m local -l -i /var/log/audit/audit.log > local.te
[root@foo ~]# cat local.te

module local 1.0;

require {
        type hald_acl_t;
        type fixed_disk_device_t;
        class blk_file getattr;

#============= hald_acl_t ==============
allow hald_acl_t fixed_disk_device_t:blk_file getattr;

[root@foo ~]# semodule -i local.te
libsepol.module_package_read_offsets: wrong magic number for module package:  expected 0xf97cff8f, got 0x646f6d0a
libsemanage.parse_module_headers: Could not parse module data.
semodule:  Failed on local.te!
Comment 1 Miroslav Grepl 2009-01-12 13:33:46 EST
You can allow this for now.

# cat /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Should be works fine.

Fixed in selinux-policy-3.5.13-39.fc10.noarch
Comment 2 Mark Watts 2009-01-13 04:19:56 EST
OK, doing this stops the errors and I can now use my disk.


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