Re: Getting udev name from usb_device structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 19, 2013 at 08:42:45PM +0200, Sergio Work wrote:
> Hi all!
> 
> I'm writting a LSM hook in order to allow to mount just only some
> particular USB Mass Storage devices according to their idVendor,
> idProduct, and Serial.

Why would this be an LSM hook?  What's wrong with the existing solutions
for this that are all in userspace today?

What security model would be using this hook, if it were present in the
kernel?

> The hook is executed when a device is going to
> be mounted, and it has the following prototype:
> 
> static int sb_mount(const char *dev_name, struct path *path, const char *type,
>                     unsigned long flags, void *data)

What about other block devices?  Why just USB?  What makes this bus
unique for pluggable storage devices?

> Can anyone advise me about how can I obtain the udev device name of a
> USB by means of the usb_device structure. Any other better idea will
> be appreciated :-)

>From userspace you can get this in sysfs, look at the links there to the
various block device entries.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux