From: "任海 " <rh_king@163.com>
To: "Guenter Roeck" <linux@roeck-us.net>
Cc: "mpearson-lenovo@squebb.ca" <mpearson-lenovo@squebb.ca>,
linux-hwmon@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re:Re: [PATCH v3 2/2] hwmon: (lenovo-ec-sensors): Fix EC "MCHP" signature validation logic
Date: Fri, 22 May 2026 09:33:17 +0800 (CST) [thread overview]
Message-ID: <3e5294b9.12cd.19e4d50bbd9.Coremail.rh_king@163.com> (raw)
In-Reply-To: <f12705e0-2e91-49db-aead-d29d92141511@roeck-us.net>
Hi Guenter,
Thanks for your patient review and approval.
Kean
At 2026-05-21 21:46:00, "Guenter Roeck" <linux@roeck-us.net> wrote:
>On Thu, May 21, 2026 at 11:52:28AM +0800, Kean Ren wrote:
>> The EC signature check uses && instead of || between the four
>> byte comparisons. With &&, the condition is true only when ALL
>> four bytes fail to match simultaneously, meaning the driver
>> accepts a device as a valid Microchip EC if ANY single byte of
>> the 4-byte "MCHP" signature happens to match.
>>
>> Due to short-circuit evaluation, if the first byte reads back as
>> 'M' (0x4D, a very common register value), the remaining three
>> comparisons are skipped entirely and the device is accepted.
>>
>> Change && to || so the check rejects devices that do not fully
>> match the expected EC signature, as originally intended.
>>
>> Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
>> Signed-off-by: Kean Ren <rh_king@163.com>
>
>Applied.
>
>Thanks,
>Guenter
prev parent reply other threads:[~2026-05-22 1:33 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 1:14 [PATCH 0/3] hwmon: lenovo-ec-sensors: Probe error handling fixes Kean
2026-05-14 1:14 ` [PATCH 1/3] hwmon: lenovo-ec-sensors: Fix EC signature check logic in probe Kean
2026-05-14 1:37 ` Guenter Roeck
2026-05-14 2:40 ` Mark Pearson
2026-05-14 1:14 ` [PATCH 2/3] hwmon: lenovo-ec-sensors: Fix NULL pointer dereference when DMI match fails Kean
2026-05-14 1:29 ` Guenter Roeck
2026-05-14 3:25 ` Guenter Roeck
2026-05-15 8:10 ` Kean
2026-05-15 8:48 ` Guenter Roeck
2026-05-15 8:30 ` Kean
2026-05-14 11:57 ` sashiko-bot
2026-05-14 1:14 ` [PATCH 3/3] hwmon: lenovo-ec-sensors: Use devm_request_region for automatic cleanup Kean
2026-05-14 1:36 ` Guenter Roeck
2026-05-14 2:39 ` Mark Pearson
2026-05-14 3:24 ` Guenter Roeck
2026-05-14 12:19 ` sashiko-bot
2026-05-20 2:29 ` [PATCH v2 0/2] hwmon: (lenovo-ec-sensors): Fix EC signature validation and I/O resource management Kean Ren
2026-05-20 2:29 ` [PATCH v2 1/2] hwmon: (lenovo-ec-sensors): Convert to devm_request_region() Kean Ren
2026-05-20 2:51 ` sashiko-bot
2026-05-20 5:03 ` Guenter Roeck
2026-05-20 5:52 ` [PATCH 2/3] hwmon: lenovo-ec-sensors: Fix NULL pointer dereference when DMI match fails Kean Ren
2026-05-20 13:11 ` Guenter Roeck
2026-05-20 2:32 ` [PATCH v2 2/2] hwmon: (lenovo-ec-sensors): Fix EC "MCHP" signature validation logic Kean Ren
2026-05-20 3:09 ` sashiko-bot
2026-05-21 3:52 ` [PATCH v3 0/2] hwmon: (lenovo-ec-sensors): Fix EC signature validation and I/O resource management Kean Ren
2026-05-21 3:52 ` [PATCH v3 1/2] hwmon: (lenovo-ec-sensors): Convert to devm_request_region() Kean Ren
2026-05-21 4:19 ` sashiko-bot
2026-05-21 13:45 ` Guenter Roeck
2026-05-21 3:52 ` [PATCH v3 2/2] hwmon: (lenovo-ec-sensors): Fix EC "MCHP" signature validation logic Kean Ren
2026-05-21 4:45 ` sashiko-bot
2026-05-21 13:46 ` Guenter Roeck
2026-05-22 1:33 ` 任海 [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=3e5294b9.12cd.19e4d50bbd9.Coremail.rh_king@163.com \
--to=rh_king@163.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mpearson-lenovo@squebb.ca \
/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