Bug 170069 - cant mount usb keys/disks as user any more.
cant mount usb keys/disks as user any more.
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Depends On:
  Show dependency treegraph
Reported: 2005-10-06 19:38 EDT by Dave Jones
Modified: 2015-01-04 17:22 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-11-03 14:32:04 EST
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 Dave Jones 2005-10-06 19:38:43 EDT
fstab contains..

/dev/sdc1               /media/key        vfat   
pamconsole,exec,noauto,user,fscontext=system_u:object_r:removable_t 0 0

yet when I try to mount it as a user, it fails, and this appears in dmesg

SELinux: security_context_to_sid(system_u:object_r:removable_t) failed for (dev
sdc1, type vfat) errno=-22

mounting it as root works. Trying to chown the files on the device fails with -EPERM

Above was with a FAT formatted usb key, but it's also repeatable with an ext3
formatted usb hard disk.
Comment 1 Daniel Walsh 2005-10-07 09:55:54 EDT
Steven and James,

Any idea why this is happening?  Is this MCS/MLS Related?
Comment 2 James Morris 2005-10-07 09:59:26 EDT
I'd say the fstab line needs to be updated to add s0 to the end of the context.
Comment 3 Daniel Walsh 2005-10-07 10:33:12 EDT
So the problem is either libsetrans is removing the :s0 file and the kernel does
not understand.  Or we have removable_t hard coded some where.  The
default_context file and media files have the :s0.

Comment 4 Daniel Walsh 2005-10-07 10:37:21 EDT
Dave edit /etc/mcs.conf and disable translations.  Uncomment the translation
line and see if it works.
Comment 5 Daniel Walsh 2005-10-07 11:29:50 EDT
I just inserted my usb stick into a rawhide machine and I am seeing

/dev/sdb on /media/usbdisk type ext2

And it seems to be working.

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