How to blacklist a USB device in lsusb?

How to blacklist a USB device in lsusb?

You can usually identify the USB device you want to blacklist via the USB IDs shown in lsusb output, written into a udev rule as shown above. However if that’s not enough there is also the udevadm info feature called “attrwalk”. For example, to walk all udev attributes of my Bluetooth hci device:

How to de-authorize a USB device in Linux?

Create a udev rule that uses the USB authorisation mechanism in the kernel to de-authorize the device. The bus will put the device into suspend mode, and it’ll never become active. I put my rule into a new file /etc/udev/rules.d/81-bluetooth-hci.rules.

How to blacklist devices in udev rules.d?

You need to add rules to /lib/udev/rules.d/ that will whitelist only the given devices, and blacklist all the rest. You can read /lib/udev/rules.d/75-persistent-net-generator.rules for examples. It shows how to filter devices and select whether to activate or not the devices. I would not be afraid of this.

Is there a way to avoid using a USB device?

On a non-technical level, avoid using any USB device that’s been plugged into a possibly-infected system, I’ve recently started to work on USBGuard which implements a USB device whitelist/blacklist with the help of UDev and the Linux kernel USB authorization feature.

What does the uvcvideo driver do on Linux?

Starting at kernel v2.6.37 the uvcvideo driver enables USB autosuspend by default. UVC devices that are not in use will be suspended after a delay to save energy (this should not be confused with system suspend, where the whole system is suspended).

How can I get UVC driver to recognize my camera?

Use the lsusb tool and look for video class interfaces like this: (In this example, the VID is 046d and the PID is 08cb.) If your device is a UVC device, you should see a number of lines that look like this: In this case the Linux UVC driver should recognize your camera when you plug it in.

Are there any UVC devices that are bug free?

Not all UVC devices are bug-free. To be fair, most UVC devices are buggy, and some of them are so broken that they will not work with the uvcvideo driver out of the box. They should not have been labelled as UVC-compliant or even been sold, but the harm is done and we need to find a way to cope with it.