mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>
Cc: Sanman Pradhan <psanman@juniper.net>,
	Arnd Bergmann <arnd@arndb.de>, Runyu Xiao <runyu.xiao@seu.edu.cn>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] hwmon: occ: validate poll response sensor blocks
Date: Mon, 20 Jul 2026 07:30:59 -0700	[thread overview]
Message-ID: <36ce8f76-4bc1-481f-a5f1-e9335fc66af3@roeck-us.net> (raw)
In-Reply-To: <20260720115826.14813-1-pengpeng@iscas.ac.cn>

On Mon, Jul 20, 2026 at 07:58:26PM +0800, Pengpeng Hou wrote:
> The OCC poll response parser walks a counted list of sensor data blocks.
> It used the static backing-array capacity as the parse boundary, but a
> transport response makes only data_length bytes current and valid. A
> truncated response can therefore make the parser consume a block header or
> block extent outside the current response.
> 
> Use data_length as the parent boundary, prove the fixed poll header and
> each current block header before reading them, and prove the complete block
> before advancing. Keep parsed sensor metadata local until the complete
> response has passed validation, then publish it. Propagate
> malformed-response errors before publishing the OCC as active.
> 
> Fixes: aa195fe49b03 ("hwmon (occ): Parse OCC poll response")
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>

The issues reported by Sashiko are pre-existing issues worth looking into,
but not as part of this patch.

Applied.

Thanks,
Guenter

      reply	other threads:[~2026-07-20 14:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 11:58 Pengpeng Hou
2026-07-20 14:30 ` 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=36ce8f76-4bc1-481f-a5f1-e9335fc66af3@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=arnd@arndb.de \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pengpeng@iscas.ac.cn \
    --cc=psanman@juniper.net \
    --cc=runyu.xiao@seu.edu.cn \
    /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®