From: sashiko-bot@kernel.org
To: "Ishaan Dandekar" <ishaan.dandekar@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH 3/3] Input: xpad - add support for generic clone X-Input gamepads
Date: Sun, 26 Jul 2026 13:33:41 +0000 [thread overview]
Message-ID: <20260726133342.565CE1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260726132039.28330-4-ishaan.dandekar@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Improper USB Device Matching causing interface hijacking
--
--- Patch [3]: [PATCH 3/3] Input: xpad - add support for generic clone X-Input gamepads ---
commit 8d8bacca3354683f27c3566047a8b73e337bdddd
Author: Ishaan Dandekar <ishaan.dandekar@gmail.com>
Input: xpad - add support for generic clone X-Input gamepads
This commit adds support for a generic X-Input gamepad (0283:0001) by adding
its vendor and product IDs to xpad_device and xpad_table to initialize it as
an X-Input gamepad.
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
[ ... ]
> @@ -496,6 +497,7 @@ static const struct usb_device_id xpad_table[] = {
> */
> { USB_INTERFACE_INFO('X', 'B', 0) }, /* Xbox USB-IF not-approved class */
> XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 controller */
> + { USB_DEVICE(0x0283, 0x0001) }, /* Generic X-Input Gamepad */
[Severity: Medium]
Will this binding hijack other interfaces on the composite USB device?
By using USB_DEVICE() here, the match flags are set to
USB_DEVICE_ID_MATCH_DEVICE, which drops interface-level matching. Because
this device is statically mapped to XTYPE_XBOX360 in xpad_device[],
xpad_probe() will skip the XTYPE_UNKNOWN interface class check.
Does this cause the xpad driver to bind to all interfaces on the device
(such as audio or standard HID) that happen to have one IN and one OUT
endpoint, stealing them from their correct drivers and creating ghost input
nodes?
Should this use XPAD_XBOX360_VENDOR(0x0283) or explicitly match the
USB_CLASS_VENDOR_SPEC interface class instead?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260726132039.28330-1-ishaan.dandekar@gmail.com?part=3
prev parent reply other threads:[~2026-07-26 13:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-26 13:20 [PATCH 0/3] Fix initialization and routing for Generic Clone X-Input Gamepads Ishaan Dandekar
2026-07-26 13:20 ` [PATCH 1/3] usbcore: Add quirk for 255-bytes initial config read Ishaan Dandekar
2026-07-26 13:28 ` Greg KH
2026-07-26 13:20 ` [PATCH 2/3] usb: quirks: Add ShanWan gamepad to quirk list Ishaan Dandekar
2026-07-26 13:29 ` Greg KH
2026-07-26 13:20 ` [PATCH 3/3] Input: xpad - add support for generic clone X-Input gamepads Ishaan Dandekar
2026-07-26 13:29 ` Greg KH
2026-07-26 13:33 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260726133342.565CE1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=ishaan.dandekar@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.