Skip to contentSkip to conversation

How to handle USB devices....

DISCUSSION Tom London 2 participants 2 messages Apr 24, 2008 SELinux security module

lore
Share & tools
lore

Tom London

author
#0 lore raw

Attempting to get '-usbdevice host:001.004' (and similar) working with qemu-kvm on my Fedora rawhide system, it occurred to me that there is the opportunity to apply policy to the files associated with USB devices. Currently, most seem to have a 'flat' label (usbfs_t), making it hard to confine qemu like programs that should only have access to, say, a single device.

Does it make sense to support more 'fine grained' labeling, and to label the associated device file (e.g., /proc/bus/usb/...., /dev/usb, etc.) when the files are 'created'?

Would udev be the place to do this? PolicyKIt?

Thoughts?

tom

Signature · 6 lines
Tom London

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 7 lines · Tom London

Attempting to get '-usbdevice host:001.004' (and similar) working with qemu-kvm on my Fedora rawhide system, it occurred to me that there is the opportunity to apply policy to the files associated with USB devices. Currently, most seem to have a 'flat' label (usbfs_t), making it hard to confine qemu like programs that should only have access to, say, a single device.

Quoted 7 lines

Does it make sense to support more 'fine grained' labeling, and to label the associated device file (e.g., /proc/bus/usb/...., /dev/usb, etc.) when the files are 'created'?

Would udev be the place to do this? PolicyKIt?

Thoughts?

Depends on the usbfs implementation in the kernel.

If the inodes are pinned in memory and can't be evicted, then we could label from userspace, although I don't know specifically what userspace agent (udev or otherwise) is appropriate there.

If the inodes can be evicted and later repopulated from internal structures, we need a way to preserve context, similar to the sysfs problem. Speaking of which, any progress on sysfs (bug 228902), Eric? We had two experimental patches for sysfs labeling a while ago, one based on genfs_contexts (kernel-managed labeling based on pathname) and one based on properly supporting setxattr and preserving contexts (userspace-managed labeling). And the necessary LSM hooks for the latter would seem to be comparable to what Dave Quigley has proposed in support of labeled NFS.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.