From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Jann Horn <jannh@google.com>, Jiri Kosina <jkosina@suse.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.12.y 2/2] HID: asus: fix missing hid_is_usb() check
Date: Wed, 26 Aug 2026 10:01:54 -0400 [thread overview]
Message-ID: <20260826140155.107206-2-sashal@kernel.org> (raw)
In-Reply-To: <20260826140155.107206-1-sashal@kernel.org>
From: Jann Horn <jannh@google.com>
[ Upstream commit 02bf61dfb44f17ec187d1da1a82495951bbd12df ]
to_usb_interface() can only be used on a hid_device whose parent is really
USB; uhid can create devices that identify as being on BUS_USB, but don't
actually have a USB parent.
Fix the use of to_usb_interface() without a hid_is_usb() check.
I have verified that it is currently possible to trigger a kernel splat due
to this bug in an ASAN build, and that this commit fixes the issue.
Fixes: 00e005c952f7 ("hid-asus: check ROG Ally MCU version and warn")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hid/hid-asus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index c9097e91f891d..28426337a2f11 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -664,7 +664,7 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
return ret;
}
- if (drvdata->quirks & QUIRK_ROG_ALLY_XPAD) {
+ if ((drvdata->quirks & QUIRK_ROG_ALLY_XPAD) && hid_is_usb(hdev)) {
intf = to_usb_interface(hdev->dev.parent);
udev = interface_to_usbdev(intf);
validate_mcu_fw_version(hdev,
--
2.53.0
prev parent reply other threads:[~2026-08-26 14:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 13:13 FAILED: patch "[PATCH] HID: asus: fix missing hid_is_usb() check" failed to apply to 6.12-stable tree gregkh
2026-08-26 14:01 ` [PATCH 6.12.y 1/2] HID: asus: simplify RGB init sequence Sasha Levin
2026-08-26 14:01 ` Sasha Levin [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=20260826140155.107206-2-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=jannh@google.com \
--cc=jkosina@suse.com \
--cc=stable@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox