Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Armin Wolf" <W_Armin@gmx.de>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v6 6/9] hwmon: (dell-smm) Use new buffer-based WMI API
Date: Wed, 10 Jun 2026 20:45:49 +0000	[thread overview]
Message-ID: <20260610204549.853551F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260610203453.816254-7-W_Armin@gmx.de>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] wmi_parse_response incorrectly fails with -ENODATA when the firmware returns fewer than 4 registers, breaking support for valid short SMM responses.
--

commit 5defcd15874af970946561c0d13ad1b0850d56ca
Author: Armin Wolf <W_Armin@gmx.de>
hwmon: (dell-smm) Use new buffer-based WMI API

This commit updates the dell-smm-hwmon driver to use the new buffer-based WMI
API. This allows the driver to also support ACPI firmware implementations that
do not use ACPI buffers for returning the results of a SMM call.

> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
> index 038edffc1ac74..6ca2ea4bfe7d3 100644
> --- a/drivers/hwmon/dell-smm-hwmon.c
> +++ b/drivers/hwmon/dell-smm-hwmon.c
> @@ -261,22 +263,19 @@ static int wmi_parse_response(u8 *buffer, u32 length, struct smm_regs *regs)
>  		&regs->ecx,
>  		&regs->edx
>  	};
> -	u32 offset = 0;
> +	size_t offset = 0;
>  	ssize_t ret;
>  	int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(registers); i++) {
>  		if (offset >= length)
>  			return -ENODATA;
>  
>  		ret = wmi_parse_register(buffer + offset, length - offset, registers[i]);
>  		if (ret < 0)
>  			return ret;
>  
> -		offset += ret;
> +		/* WMI aligns u32 integers on a 4 byte boundary */
> +		offset = ALIGN(offset + ret, 4);
>  	}
>  
> -	if (offset != length)
> -		return -ENOMSG;
> -
>  	return 0;
>  }

[Severity: High]
Does wmi_parse_response() incorrectly fail with -ENODATA when the firmware
returns fewer than 4 registers, breaking support for valid short SMM responses?

Based on the changes, it appears the parsing loop previously allowed a short
response to be fully consumed (where offset == length), eventually verifying
it and successfully returning 0 while leaving any unprovided registers
unchanged.

With the updated code, if a BIOS legitimately returns a valid WMI response
containing 1, 2, or 3 registers (e.g., 8, 16, or 24 bytes), the loop parses
the provided registers and increments offset to equal length. On the
subsequent iteration, it evaluates offset >= length as true. 

Instead of succeeding, will this now fail the entire SMM call with -ENODATA?

Could this functional regression break hardware monitoring (e.g., fan speed,
temperatures) on Dell systems whose BIOS provides short WMI SMM responses?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260610203453.816254-1-W_Armin@gmx.de?part=6

  reply	other threads:[~2026-06-10 20:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10 20:34 [PATCH v6 0/9] Convert most Dell WMI drivers to use the new buffer-based API Armin Wolf
2026-06-10 20:34 ` [PATCH v6 1/9] platform/x86: dell-descriptor: Use new buffer-based WMI API Armin Wolf
2026-06-10 20:41   ` sashiko-bot
2026-06-10 20:34 ` [PATCH v6 2/9] platform/x86: dell-privacy: " Armin Wolf
2026-06-10 20:45   ` sashiko-bot
2026-06-10 20:34 ` [PATCH v6 3/9] platform/x86: dell-smbios-wmi: " Armin Wolf
2026-06-10 20:47   ` sashiko-bot
2026-06-10 20:34 ` [PATCH v6 4/9] platform/x86: dell-wmi-base: " Armin Wolf
2026-06-10 20:46   ` sashiko-bot
2026-06-10 20:34 ` [PATCH v6 5/9] platform/x86: dell-ddv: " Armin Wolf
2026-06-10 20:47   ` sashiko-bot
2026-06-10 20:34 ` [PATCH v6 6/9] hwmon: (dell-smm) " Armin Wolf
2026-06-10 20:45   ` sashiko-bot [this message]
2026-06-10 21:29     ` Armin Wolf
2026-06-10 20:34 ` [PATCH v6 7/9] platform/wmi: Make wmi_bus_class const Armin Wolf
2026-06-10 20:40   ` sashiko-bot
2026-06-10 20:34 ` [PATCH v6 8/9] platform/wmi: Make sysfs attributes const Armin Wolf
2026-06-10 20:43   ` sashiko-bot
2026-06-10 20:34 ` [PATCH v6 9/9] modpost: Handle malformed WMI GUID strings Armin Wolf
2026-06-10 20:50   ` sashiko-bot
2026-06-10 21:05   ` Pali Rohár
2026-06-10 21:31     ` Armin Wolf

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=20260610204549.853551F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=W_Armin@gmx.de \
    --cc=linux-hwmon@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox