[PATCH v2 0/2] HID: lenovo-go: clean up USB assumption

Louis Clinckx posted 2 patches 1 week, 2 days ago
drivers/hid/hid-lenovo-go-s.c | 11 ++++++-----
drivers/hid/hid-lenovo-go.c   |  6 +++---
2 files changed, 9 insertions(+), 8 deletions(-)
[PATCH v2 0/2] HID: lenovo-go: clean up USB assumption
Posted by Louis Clinckx 1 week, 2 days ago
These drivers' id_tables only match HID_USB_DEVICE() entries and the
code freely assumes a USB transport (to_usb_interface() on hdev->dev.parent,
endpoint access in raw_event). Make the assumption explicit at probe and
drop a NULL check that the compiler-level definition of to_usb_interface()
makes unreachable.

No functional change for the supported (USB) devices.

Louis Clinckx (2):
  HID: lenovo-go: reject non-USB transports in probe
  HID: lenovo-go: drop dead NULL check on to_usb_interface()

 drivers/hid/hid-lenovo-go-s.c | 11 ++++++-----
 drivers/hid/hid-lenovo-go.c   |  6 +++---
 2 files changed, 9 insertions(+), 8 deletions(-)

---
Changes since v1:
 - Resubmitted on linux-input as a quality fix per Benjamin's review of v1
   (sent to security@kernel.org; the HID_USB_DEVICE() id_table already
    filters BUS_USB, so no exploitable path).
 - Added patch 2 to remove the dead NULL check, at Derek's suggestion.

base-commit: 50897c955902c93ae71c38698abb910525ebdc89
--
2.39.5
Re: [PATCH v2 0/2] HID: lenovo-go: clean up USB assumption
Posted by Benjamin Tissoires 3 days, 16 hours ago
On Fri, 15 May 2026 14:57:38 +0000, Louis Clinckx wrote:
> These drivers' id_tables only match HID_USB_DEVICE() entries and the
> code freely assumes a USB transport (to_usb_interface() on hdev->dev.parent,
> endpoint access in raw_event). Make the assumption explicit at probe and
> drop a NULL check that the compiler-level definition of to_usb_interface()
> makes unreachable.
> 
> No functional change for the supported (USB) devices.
> 
> [...]

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git (for-7.1/upstream-fixes), thanks!

[1/2] HID: lenovo-go: reject non-USB transports in probe
      https://git.kernel.org/hid/hid/c/2ee7e632405b
[2/2] HID: lenovo-go: drop dead NULL check on to_usb_interface()
      https://git.kernel.org/hid/hid/c/da7f96a68c39

Cheers,
-- 
Benjamin Tissoires <bentiss@kernel.org>
Re: [PATCH v2 0/2] HID: lenovo-go: clean up USB assumption
Posted by Derek J. Clark 1 week, 2 days ago
On May 15, 2026 7:57:38 AM PDT, Louis Clinckx <clinckx.louis@gmail.com> wrote:
>These drivers' id_tables only match HID_USB_DEVICE() entries and the
>code freely assumes a USB transport (to_usb_interface() on hdev->dev.parent,
>endpoint access in raw_event). Make the assumption explicit at probe and
>drop a NULL check that the compiler-level definition of to_usb_interface()
>makes unreachable.
>
>No functional change for the supported (USB) devices.
>
>Louis Clinckx (2):
>  HID: lenovo-go: reject non-USB transports in probe
>  HID: lenovo-go: drop dead NULL check on to_usb_interface()
>
> drivers/hid/hid-lenovo-go-s.c | 11 ++++++-----
> drivers/hid/hid-lenovo-go.c   |  6 +++---
> 2 files changed, 9 insertions(+), 8 deletions(-)
>
>---
>Changes since v1:
> - Resubmitted on linux-input as a quality fix per Benjamin's review of v1
>   (sent to security@kernel.org; the HID_USB_DEVICE() id_table already
>    filters BUS_USB, so no exploitable path).
> - Added patch 2 to remove the dead NULL check, at Derek's suggestion.
>
>base-commit: 50897c955902c93ae71c38698abb910525ebdc89
>--
>2.39.5
>

Thanks for the quick turnaround on this. I've already tested these changes, so for the series:
Reviewed-by: Derek J. Clark <derekjoh.clark@gmail.com>
Tested-by: Derek J. Clark <derekjohn.clark@gmail.com>

Thanks,
Derek