Re: usbfs, claiming entire usb devices

From: Alan Cox
Date: Sat May 09 2009 - 13:17:11 EST


> > Yes.  That is, a process shouldn't be allowed to access a locked device
> > unless that process is the lock holder.
>
> You think the pid or the uid would make more sense?

How about neither ?

The standard Unix behaviour is to open the file O_EXCL if you want
exclusivity. Neither uid or pid are helpful or work in the many
environments where you want security - in particular where (as is very
common with user space driver type code) you want parts of your code
running setuid and parts not, as two processes with different pid and uid
values.

If O_EXCL is interpeted as exclusive access (versus kernel and re-open of
the same node) then you can implement the rest of the sematics in user
space.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/