From: sashiko-bot@kernel.org
To: "Maoyi Xie" <maoyixie.tju@gmail.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: (occ) Check sensor_length against the sensor struct size
Date: Fri, 27 Nov 2026 09:13:15 +0000 [thread overview]
Message-ID: <sashiko-outbox-236952@kernel.org> (raw)
In-Reply-To: <20261127090837.164246-1-maoyixie.tju@gmail.com>
> occ_parse_poll_response() bounds each sensor block by
> num_sensors * sensor_length. The show functions index the block with
> fixed structs, such as the 68-byte struct power_sensor_a0. A smaller
> sensor_length passes this check. The reads then run up to 17340 bytes
> past the block.
>
> Ignore a block whose sensor_length is smaller than the entry read by the
> show functions, like a block of unknown type. A larger sensor_length is
> still accepted, because the reads stay inside the block.
>
> Found with a CodeQL-based static analysis tool that we are developing.
> Reproduced in a userspace harness under AddressSanitizer. Not tested
> on hardware.
>
> Fixes: c10e753d43eb ("hwmon (occ): Add sensor types and versions")
> Cc: stable@vger.kernel.org
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Closes: https://lore.kernel.org/all/20260617201822.3B46E1F000E9@smtp.kernel.org/
> Reported-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
> Link: https://lore.kernel.org/all/20260619023019.1064970-1-runyu.xiao@seu.edu.cn/
> Signed-off-by: Maoyi Xie <maoyixie.tju@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261127090837.164246-1-maoyixie.tju@gmail.com?part=1
prev parent reply other threads:[~2026-11-27 9:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 9:08 [PATCH] hwmon: (occ) Check sensor_length against the sensor struct size Maoyi Xie
2026-11-27 9:13 ` 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=sashiko-outbox-236952@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=maoyixie.tju@gmail.com \
--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.