# Re: \[PATCH v3 3/3\] HID: check for valid USB device for many HID drivers

- From: Greg Kroah-Hartman \<gregkh@linuxfoundation.org\>
- Date: 2021-12-02 09:25:55 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2021/12/8933626
- Thread: https://ratatoskr.run/linux-input/2021/12/8933620/t.md

```text
On Thu, Dec 02, 2021 at 10:08:07AM +0100, Benjamin Tissoires wrote:
> On Wed, Dec 1, 2021 at 7:35 PM Greg Kroah-Hartman
> [ref] wrote:
> >
> > Many HID drivers assume that the HID device assigned to them is a USB
> > device as that was the only way HID devices used to be able to be
> > created in Linux.  However, with the additional ways that HID devices
> > can be created for many different bus types, that is no longer true, so
> > properly check that we have a USB device associated with the HID device
> > before allowing a driver that makes this assumption to claim it.
> >
> > Cc: Jiri Kosina <jikos@kernel.org>
> > Cc: Benjamin Tissoires <redacted>
> > Cc: Michael Zaidman <michael.zaidman@gmail.com>
> > Cc: Stefan Achatz <erazor_de@users.sourceforge.net>
> > Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> > Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> > Cc: <redacted>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> > v3: add check in hid-sony based on fix from Benjamin.
> 
> Sigh. This morning I realized my fix was incomplete as the error path
> of the GHL devices handling is not releasing the hidraw node.
> I have a followup patch ready that I am about to send as soon as I get
> the full tests run.
> 
> Also, I guess we want this series to land in 5.16-rc4 or rc5 and mark
> it as stable, no?
> If so, I'll add the cc stable@vger.kernel.org marks so you don't need
> to keep tabs on it.

That would be great, thanks!

> Besides that, I tested the wacom change on an I2C screen, and it is
> still working as expected, so I think the wacom changes are safe.
> The full series is
> Tested-by: Benjamin Tissoires <redacted>

Wonderful.

Note, I did just get some really odd 0-day error messages from this
patch series:
	https://lore.kernel.org/r/202112021000.3GKuE8mS-lkp@intel.com
	https://lore.kernel.org/r/202112020808.AZ5usuXj-lkp@intel.com

Which looks like a dependancy issue that might have always been there.
I'll work on resolving that after lunch...

thanks,

greg k-h
```
