From: Guenter Roeck <linux@roeck-us.net>
To: "Pradhan, Sanman" <sanman.pradhan@hpe.com>
Cc: "linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
"iwona.winiarska@intel.com" <iwona.winiarska@intel.com>,
"corbet@lwn.net" <corbet@lwn.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Sanman Pradhan <psanman@juniper.net>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 2/2] hwmon: (peci/cputemp) Fix off-by-one in cputemp_is_visible()
Date: Sun, 22 Mar 2026 18:40:50 -0700 [thread overview]
Message-ID: <36950a5e-476d-412e-8f3f-da74e6e5303b@roeck-us.net> (raw)
In-Reply-To: <20260323002352.93417-3-sanman.pradhan@hpe.com>
On Mon, Mar 23, 2026 at 12:24:37AM +0000, Pradhan, Sanman wrote:
> From: Sanman Pradhan <psanman@juniper.net>
>
> cputemp_is_visible() validates the channel index against
> CPUTEMP_CHANNEL_NUMS, but currently uses '>' instead of '>='.
> As a result, channel == CPUTEMP_CHANNEL_NUMS is not rejected even though
> valid indices are 0 .. CPUTEMP_CHANNEL_NUMS - 1.
>
> Fix the bounds check by using '>=' so invalid channel indices are
> rejected before indexing the core bitmap.
>
> Fixes: bf3608f338e9 ("hwmon: peci: Add cputemp driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Sanman Pradhan <psanman@juniper.net>
Applied.
Thanks,
Guenter
prev parent reply other threads:[~2026-03-23 1:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 0:24 [PATCH 0/2] hwmon: (peci/cputemp) Fix temp*_crit_hyst and cputemp_is_visible() bounds check Pradhan, Sanman
2026-03-23 0:24 ` [PATCH 1/2] hwmon: (peci/cputemp) Fix crit_hyst returning delta instead of absolute temperature Pradhan, Sanman
2026-03-23 1:40 ` Guenter Roeck
2026-03-23 0:24 ` [PATCH 2/2] hwmon: (peci/cputemp) Fix off-by-one in cputemp_is_visible() Pradhan, Sanman
2026-03-23 1:40 ` 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=36950a5e-476d-412e-8f3f-da74e6e5303b@roeck-us.net \
--to=linux@roeck-us.net \
--cc=corbet@lwn.net \
--cc=iwona.winiarska@intel.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=psanman@juniper.net \
--cc=sanman.pradhan@hpe.com \
--cc=stable@vger.kernel.org \
/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®