Re: [PATCH v2] hwmon: (aquacomputer_d5next) reject short status reports

From: Guenter Roeck

Date: Sun Oct 25 2026 - 20:58:41 EST


On Wed, Oct 21, 2026 at 08:04:07PM +0800, Jiale Yao wrote:
> The HID raw_event callback runs before HID core validates the received
> report length. aqc_raw_event() reads device-specific status fields at fixed
> offsets, including multi-byte values, without first ensuring that the
> received buffer contains every field. A truncated report can therefore
> cause out-of-bounds reads and update hwmon state with unrelated data.
>
> The required length differs between supported devices and cannot be
> derived from the HID report descriptor. Define the minimum length needed
> by each asynchronous status format, select it while configuring the
> device, and reject reports that do not contain the last field accessed by
> that format. Keep the published length zero until probe configuration is
> complete, which also excludes legacy devices whose status is retrieved
> through feature reports.
>
> Suggested-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> Fixes: 0e35f63f7f4e ("hwmon: add driver for Aquacomputer D5 Next")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>

Applied.

Thanks,
Guenter