From: sashiko-bot@kernel.org
To: "Edward Adam Davis" <eadavis@qq.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v3] hwmon: (aquacomputer_d5next) valid the data size before reading the sensor data
Date: Sat, 22 Aug 2026 09:26:16 +0000 [thread overview]
Message-ID: <20260822092616.B9B121F000E9@smtp.kernel.org> (raw)
In-Reply-To: <tencent_54372C4A0A752D77EF66BC3CA9377097F009@qq.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] The newly added validation function `aqc_raw_data_valid` is incomplete and leaves multiple out-of-bounds reads unhandled.
- [High] NULL pointer dereference when a malicious USB device spoofing an `aquastreamxt` device sends a STATUS_REPORT_ID (0x01) input report.
--
--- Patch [1]: [PATCH v3] hwmon: (aquacomputer_d5next) valid the data size before reading the sensor data ---
commit f2f8bc6cd48d08e98637bc3e14b8b66f1ed8bcd4
Author: Edward Adam Davis <eadavis@qq.com>
Subject: hwmon: (aquacomputer_d5next) valid the data size before reading the sensor data
This commit adds a data size check function, aqc_raw_data_valid(), to prevent
out-of-bounds reads when a device sends a truncated HID report. It aborts the
sensor data read operation if the received data size is smaller than required.
Link: https://syzkaller.appspot.com/bug?extid=9ee5f5dc18673d6b2f37
> diff --git a/drivers/hwmon/aquacomputer_d5next.c b/drivers/hwmon/aquacomputer_d5next.c
> index 1ca70e7262988..2381a74eb4a48 100644
> --- a/drivers/hwmon/aquacomputer_d5next.c
> +++ b/drivers/hwmon/aquacomputer_d5next.c
[ ... ]
> + /* Fan speed and related readings data size check */
> + for (i = 0; i < priv->num_fans; i++) {
> + fan_off = priv->fan_sensor_offsets[i] + 1;
> + off = fan_off + priv->fan_structure->power;
[Severity: High]
This is a pre-existing issue, but does this code lead to a NULL pointer
dereference for aquastreamxt devices?
For legacy aquastreamxt devices, priv->num_fans is initialized to 2,
but priv->fan_structure is left unassigned (NULL). Legacy devices
normally communicate using report ID 0x04. If a malicious USB device
spoofs an aquastreamxt device and sends a report with
STATUS_REPORT_ID (0x01), would aqc_raw_data_valid() and
aqc_raw_event() blindly dereference priv->fan_structure->power?
Additionally, while this patch attempts to fix the out-of-bounds
reads, are we missing bounds checking for priv->fan_structure->speed
here?
The speed attribute often has the largest offset
(e.g., AQC_FAN_SPEED_OFFSET is 0x08, while power is 0x06). Could a
truncated report still cause an out-of-bounds read when accessing
the speed offset later in aqc_raw_event()?
> + if (off >= size) {
> + msg = "fan power offset";
> + goto invalid;
> + }
> +
> + off = fan_off + priv->fan_structure->voltage;
> + if (off >= size) {
> + msg = "fan voltage offset";
> + goto invalid;
> + }
> +
> + off = fan_off + priv->fan_structure->curr;
> + if (off >= size) {
> + msg = "fan curr offset";
> + goto invalid;
> + }
> + }
> +
[Severity: High]
This is a pre-existing issue, but does this function leave several
out-of-bounds reads unprotected?
The new aqc_raw_data_valid() function skips checking
priv->flow_sensors_start_offset, priv->power_cycle_count_offset, and
device-specific sensors (like LEAKSHIELD_RESERVOIR_VOLUME). If a
malicious USB device sends a short HID report with STATUS_REPORT_ID,
could these reads still trigger a slab-out-of-bounds access inside
aqc_raw_event()?
> + return true;
> +invalid:
> + pr_debug("data size (%d) is less than the %s, %s\n",
> + size, msg, __func__);
> + return false;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/tencent_54372C4A0A752D77EF66BC3CA9377097F009@qq.com?part=1
next prev parent reply other threads:[~2026-08-22 9:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 3:06 [syzbot] [hwmon?] KASAN: slab-out-of-bounds Read in aqc_raw_event syzbot
2026-08-22 4:02 ` Guenter Roeck
2026-08-22 8:07 ` Aleksa Savic
2026-08-22 14:24 ` Guenter Roeck
2026-08-22 5:07 ` Edward Adam Davis
2026-08-22 5:28 ` syzbot
2026-08-22 5:34 ` [PATCH] hwmon: valid the data size before reading the sensor data Edward Adam Davis
2026-08-22 5:44 ` sashiko-bot
2026-08-22 7:45 ` [PATCH v2] " Edward Adam Davis
2026-08-22 7:54 ` Guenter Roeck
2026-08-22 7:57 ` sashiko-bot
2026-08-22 9:14 ` [PATCH v3] hwmon: (aquacomputer_d5next) " Edward Adam Davis
2026-08-22 9:26 ` sashiko-bot [this message]
2026-08-22 11:34 ` [PATCH v4] " Edward Adam Davis
2026-08-22 11:47 ` sashiko-bot
2026-08-22 11:55 ` Greg KH
2026-08-22 12:23 ` Edward Adam Davis
2026-08-22 12:45 ` Greg KH
2026-08-22 13:03 ` Edward Adam Davis
2026-08-22 14:05 ` [PATCH v5] " Edward Adam Davis
2026-08-22 14:20 ` sashiko-bot
2026-08-22 14:25 ` Guenter Roeck
2026-08-22 6:41 ` [PATCH] hwmon: " Guenter Roeck
2026-08-22 7:54 ` Edward Adam Davis
2026-08-22 7:00 ` [syzbot] [hwmon?] KASAN: slab-out-of-bounds Read in aqc_raw_event Edward Adam Davis
2026-08-22 7:44 ` syzbot
2026-08-22 8:38 ` Edward Adam Davis
2026-08-22 9:03 ` syzbot
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=20260822092616.B9B121F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=eadavis@qq.com \
--cc=linux-hwmon@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.