From: sashiko-bot@kernel.org
To: "Sriman Achanta" <srimanachanta@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v4 10/10] HID: steelseries: Add support for Arctis Nova 7 Gen2 family
Date: Tue, 23 Jun 2026 17:35:11 +0000 [thread overview]
Message-ID: <20260623173511.9B7531F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260623172310.272708-11-srimanachanta@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Medium] The unconditional minimum size check in the Gen2 parsing function may silently drop valid unsolicited status updates.
Pre-existing issues:
- [High] Unsafe fetching of the sibling interface's private data lacks driver validation and synchronization, leading to Type Confusion and Use-After-Free.
--
commit ca415cb624472143e783db3389a867c4e203e6c8
Author: Sriman Achanta <srimanachanta@gmail.com>
HID: steelseries: Add support for Arctis Nova 7 Gen2 family
This commit adds support for the Arctis Nova 7 Gen2 headsets.
It introduces a new parsing helper for the Gen2 status format and uses an
async interface to handle unsolicited battery and connection updates without
polling.
> diff --git a/drivers/hid/hid-steelseries-arctis.c b/drivers/hid/hid-steelseries-arctis.c
> --- a/drivers/hid/hid-steelseries-arctis.c
> +++ b/drivers/hid/hid-steelseries-arctis.c
[ ... ]
> @@ -163,6 +170,30 @@ static void steelseries_arctis_9_parse_status(struct steelseries_device *sd,
> }
> }
>
> +static void steelseries_arctis_nova_7_gen2_parse_status(struct steelseries_device *sd,
> + u8 *data, int size)
> +{
> + if (size < 4)
> + return;
[Severity: Medium]
Will this strict minimum size check silently drop valid short packets?
Since opcodes like 0xb7, 0xb9, and 0xbb only appear to require 2 bytes of
payload (e.g., data[0] and data[1]), if the hardware sends an unsolicited
report as a 2 or 3 byte packet, it seems it would be dropped before
processing.
> +
> + switch (data[0]) {
> + case 0xb0:
> + sd->headset_connected = (data[1] == 0x03);
> + sd->battery_capacity = data[2];
> + sd->battery_charging = (data[3] == 0x01);
> + break;
> + case 0xb7:
> + sd->battery_capacity = data[1];
> + break;
> + case 0xb9:
> + sd->headset_connected = (data[1] == 0x03);
> + break;
> + case 0xbb:
> + sd->battery_charging = (data[1] == 0x01);
> + break;
> + }
> +}
> +
> /*
> * Device info definitions
> */
> @@ -181,6 +212,14 @@ static const struct steelseries_device_info arctis_9_info = {
> .parse_status = steelseries_arctis_9_parse_status,
> };
>
> +static const struct steelseries_device_info arctis_nova_7_gen2_info = {
> + .sync_interface = 3,
> + .async_interface = 5,
[Severity: High]
This isn't a bug introduced by this patch, but since these devices use an
async interface, does the sibling interface lookup in
steelseries_get_sibling_hdev() have adequate locking and validation?
When a device probes the async interface, it appears
steelseries_get_sibling_hdev() fetches intfdata from the sibling interface
via usb_get_intfdata() locklessly.
If the sibling interface (interface 3) is unbound via sysfs and bound to
another driver (like usbfs), or physically unplugged concurrently, could
this return a foreign private context or a soon-to-be-freed pointer?
Then in steelseries_arctis_probe(), this unvalidated pointer is cast and
dereferenced to get the driver data:
sd = hid_get_drvdata(master_hdev);
kref_get(&sd->refcnt);
Could this lead to type confusion or a use-after-free if the sibling driver
is no longer the expected usbhid driver?
> + .capabilities = SS_CAP_BATTERY,
> + .request_status = steelseries_arctis_nova_request_status,
> + .parse_status = steelseries_arctis_nova_7_gen2_parse_status,
> +};
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260623172310.272708-1-srimanachanta@gmail.com?part=10
prev parent reply other threads:[~2026-06-23 17:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 17:23 [PATCH v4 00/10] HID: steelseries: Refactor Arctis driver and add Arctis Nova 7 Gen2 support Sriman Achanta
2026-06-23 17:23 ` [PATCH v4 01/10] HID: steelseries: Fix ARCTIS_1_X device mislabeling Sriman Achanta
2026-06-23 17:23 ` [PATCH v4 02/10] HID: steelseries: Fix whitespace in srws1 report descriptor Sriman Achanta
2026-06-23 17:23 ` [PATCH v4 03/10] HID: steelseries: Split Arctis headset driver into separate module Sriman Achanta
2026-06-23 17:23 ` [PATCH v4 04/10] HID: steelseries: Inline and simplify SRWS1 wheel driver Sriman Achanta
2026-06-23 17:23 ` [PATCH v4 05/10] HID: steelseries: Refactor Arctis driver to use device_info framework Sriman Achanta
2026-06-23 17:33 ` sashiko-bot
2026-06-23 17:23 ` [PATCH v4 06/10] HID: steelseries: Report POWER_SUPPLY_STATUS_FULL when full Sriman Achanta
2026-06-23 17:23 ` [PATCH v4 07/10] HID: steelseries: Correct Arctis 9 battery calibration range Sriman Achanta
2026-06-23 17:23 ` [PATCH v4 08/10] HID: steelseries: Manage battery lifetime with refcounting Sriman Achanta
2026-06-23 17:36 ` sashiko-bot
2026-06-23 17:23 ` [PATCH v4 09/10] HID: steelseries: Add async status interface support Sriman Achanta
2026-06-23 17:36 ` sashiko-bot
2026-06-23 17:23 ` [PATCH v4 10/10] HID: steelseries: Add support for Arctis Nova 7 Gen2 family Sriman Achanta
2026-06-23 17:35 ` 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=20260623173511.9B7531F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=srimanachanta@gmail.com \
/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