From: Guenter Roeck <linux@roeck-us.net>
To: Edward Adam Davis <eadavis@qq.com>, sashiko-bot@kernel.org
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org, me@jackdoan.com,
savicaleksa83@gmail.com, syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH v2] hwmon: valid the data size before reading the sensor data
Date: Sat, 22 Aug 2026 00:54:58 -0700 [thread overview]
Message-ID: <6fbb0f5b-ea29-41c6-8b13-c15e83af71d1@roeck-us.net> (raw)
In-Reply-To: <tencent_D74E75F577C166FC3CBB36B6966836D44A09@qq.com>
On 8/22/26 00:45, Edward Adam Davis wrote:
> The user-forged sensor data is only 65 bytes long; however, aqc_raw_event()
> fails to handle cases where the sensor data length is too small when reading
> the data, resulting in [1] during the read process.
>
> Add a data size check, if the size is less than that required for the
> specific data item to be read, abort the sensor data read operation.
>
> [1]
> BUG: KASAN: slab-out-of-bounds in aqc_raw_event+0x213e/0x25d0 drivers/hwmon/aquacomputer_d5next.c:1327
> Read of size 2 at addr ffff888108aba257 by task swapper/1/0
> Call Trace:
> get_unaligned_be16 include/linux/unaligned.h:48 [inline]
> aqc_raw_event drivers/hwmon/aquacomputer_d5next.c:1345 [inline]
> aqc_raw_event+0x213e/0x25d0 drivers/hwmon/aquacomputer_d5next.c:1327
> __hid_input_report.constprop.0+0x319/0x470 drivers/hid/hid-core.c:2168
> hid_irq_in+0x55d/0x710 drivers/hid/usbhid/hid-core.c:287
> __usb_hcd_giveback_urb+0x38d/0x610 drivers/usb/core/hcd.c:1657
> usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
>
> Fixes: 0e35f63f7f4e ("hwmon: add driver for Aquacomputer D5 Next")
> Reported-by: syzbot+9ee5f5dc18673d6b2f37@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=9ee5f5dc18673d6b2f37
> Tested-by: syzbot+9ee5f5dc18673d6b2f37@syzkaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> ---
> v1 -> v2: change to check the data item and update comments
Please stop sending me AI generated patches. Whatever model you are using
has no clue what it is doing.
Guenter
prev parent reply other threads:[~2026-08-22 7:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260822054428.D55F71F000E9@smtp.kernel.org>
2026-08-22 7:45 ` Edward Adam Davis
2026-08-22 7:54 ` Guenter Roeck [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=6fbb0f5b-ea29-41c6-8b13-c15e83af71d1@roeck-us.net \
--to=linux@roeck-us.net \
--cc=eadavis@qq.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=me@jackdoan.com \
--cc=sashiko-bot@kernel.org \
--cc=savicaleksa83@gmail.com \
--cc=syzkaller-bugs@googlegroups.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
all inboxes | Powered by JetHome®