From: Edward Adam Davis <eadavis@qq.com>
To: linux@roeck-us.net
Cc: eadavis@qq.com, linux-hwmon@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
me@jackdoan.com, savicaleksa83@gmail.com,
syzbot+9ee5f5dc18673d6b2f37@syzkaller.appspotmail.com,
syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] hwmon: valid the data size before reading the sensor data
Date: Sat, 22 Aug 2026 15:54:57 +0800 [thread overview]
Message-ID: <tencent_73C30DF79232DDC35D9A9940CF9B8DB92507@qq.com> (raw)
In-Reply-To: <31df411d-e257-458d-98e5-c2920915294d@roeck-us.net>
On Fri, 21 Aug 2026 23:41:26 -0700, Guenter Roeck wrote:
> Subject is supposed to be "hwmon: (driver) Description".
Oh, got it.
>
> On 8/21/26 22:34, 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 smaller than the buffer
> > size when reading the data, resulting in [1] during the read process.
> >
>
> The device simulated by syzbot is D5 next, and its control buffer size is
> 0x329 or 809. I _asked_ earlier if that is the value to check against,
> but did not claim that this is actually the case.
>
> We know that the report must be much longer than 65 bytes. D5NEXT_PUMP_OFFSET
> is 0x6c = 108, and the field is two bytes long, meaning the report size
> must be at least 110 bytes long. What we do not know is its actual length.
>
> > Add a check for the data size, if it less than the buffer size, the sensor
> > data read is aborted.
> >
>
> Apparently Sashiko is aware that this is wrong - not only is the report size
> smaller than 809 bytes, but apparently buffer_size is not even set for all
> supported devices.
Yes, I also realized that relying solely on the buffer size for the check
might be too simplistic or crude, so I adjusted the data length verification
method and submitted a second version of the patch.
BR,
Edward
next prev parent reply other threads:[~2026-08-22 7:55 UTC|newest]
Thread overview: 13+ 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 6:41 ` Guenter Roeck
2026-08-22 7:54 ` Edward Adam Davis [this message]
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=tencent_73C30DF79232DDC35D9A9940CF9B8DB92507@qq.com \
--to=eadavis@qq.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=me@jackdoan.com \
--cc=savicaleksa83@gmail.com \
--cc=syzbot+9ee5f5dc18673d6b2f37@syzkaller.appspotmail.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