3

I'm trying to block a device at kernel level. To be specific, When USB device (USB Mass Storage Device) is plugged in, I want to get its vendorid, productid, serial and let my user space thread decide whether the device attach/detach.

And I met a problem, How could I let the driver wait for my user space thread's processed result(if the device is authorized).

Hasturkun
  • 35,395
  • 6
  • 71
  • 104
  • 3
    It's possible to blacklist the device completely using udev, but communicating from user space to kernel space seems to be a bad practice. – Tatsuyuki Ishi Mar 13 '17 at 08:20
  • when a new usb device plugged in, and the new device's info isn't in the udev list, But I need to get the info and decide if the usb device is able to be attached, how could I do that –  Mar 13 '17 at 13:50
  • Read `udev` documentation carefully. Almost everything you mentioned is available to the RULE which `udev` will use to decide how to proceed. – 0andriy Mar 13 '17 at 20:26
  • Ok, I will look into that. Thank you a lot –  Mar 14 '17 at 01:55

0 Answers0