From: sashiko-bot@kernel.org
To: "Armin Wolf" <W_Armin@gmx.de>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v4 1/9] platform/x86: dell-descriptor: Use new buffer-based WMI API
Date: Fri, 05 Jun 2026 18:25:48 +0000 [thread overview]
Message-ID: <20260605182549.063021F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260605181433.188847-2-W_Armin@gmx.de>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] Incorrect sizeof argument used in strncmp for object_signature validation.
- [Low] The interface version validation implicitly accepts version 2 without documentation.
--
commit 5b70a5d7de7afeabc7feebda00fbadd39ea87afa
Author: Armin Wolf <W_Armin@gmx.de>
platform/x86: dell-descriptor: Use new buffer-based WMI API
This commit updates the dell-descriptor driver to use the new buffer-based
WMI API. This allows supporting ACPI firmware implementations that do not
use ACPI buffers for the descriptor.
> diff --git a/drivers/platform/x86/dell/dell-wmi-descriptor.c b/drivers/platform/x86/dell/dell-wmi-descriptor.c
> index c2a1802027190..d1e751d430210 100644
> --- a/drivers/platform/x86/dell/dell-wmi-descriptor.c
> +++ b/drivers/platform/x86/dell/dell-wmi-descriptor.c
[ ... ]
> @@ -88,77 +108,47 @@ bool dell_wmi_get_hotfix(u32 *hotfix)
[ ... ]
> - if (strncmp(obj->string.pointer, "DELL WMI", 8) != 0) {
> - dev_err(&wdev->dev, "Dell descriptor buffer has invalid signature (%8ph)\n",
> - buffer);
> - ret = -EINVAL;
> - descriptor_valid = ret;
> - goto out;
> + if (strncmp(desc->object_signature, " WMI", sizeof(desc->vendor_signature))) {
[Severity: Low]
Is this using the correct size field? The strncmp compares object_signature
but passes sizeof(desc->vendor_signature) instead of
sizeof(desc->object_signature). While functionally benign right now since
both fields are exactly 4 bytes long, this looks like a copy-paste error
that could be fragile if the structure ever changes.
> + dev_err(&wdev->dev, "Dell descriptor buffer has invalid object signature (%4ph)\n",
> + desc->object_signature);
> + descriptor_valid = -ENOMSG;
> + return -ENOMSG;
> }
> descriptor_valid = 0;
>
> - if (buffer[2] != 0 && buffer[2] != 1)
> - dev_warn(&wdev->dev, "Dell descriptor buffer has unknown version (%lu)\n",
> - (unsigned long) buffer[2]);
> -
> - priv = devm_kzalloc(&wdev->dev, sizeof(struct descriptor_priv),
> - GFP_KERNEL);
> + if (le32_to_cpu(desc->interface_version) > 2)
[Severity: Low]
Does this code intentionally change the supported version checks?
The previous code explicitly checked if the version was not 0 and not 1,
and warned otherwise. This new check implicitly accepts version 2 as a
valid, known version without warning.
Since the commit message doesn't mention adding support for a new interface
version, should this > 2 check be > 1 instead?
> + dev_warn(&wdev->dev, "Dell descriptor buffer has unknown version (%u)\n",
> + le32_to_cpu(desc->interface_version));
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260605181433.188847-1-W_Armin@gmx.de?part=1
next prev parent reply other threads:[~2026-06-05 18:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 18:14 [PATCH v4 0/9] Convert most Dell WMI drivers to use the new buffer-based API Armin Wolf
2026-06-05 18:14 ` [PATCH v4 1/9] platform/x86: dell-descriptor: Use new buffer-based WMI API Armin Wolf
2026-06-05 18:25 ` sashiko-bot [this message]
2026-06-05 18:14 ` [PATCH v4 2/9] platform/x86: dell-privacy: " Armin Wolf
2026-06-05 18:35 ` sashiko-bot
2026-06-05 18:14 ` [PATCH v4 3/9] platform/x86: dell-smbios-wmi: " Armin Wolf
2026-06-05 18:43 ` sashiko-bot
2026-06-05 18:14 ` [PATCH v4 4/9] platform/x86: dell-wmi-base: " Armin Wolf
2026-06-05 18:52 ` sashiko-bot
2026-06-05 18:14 ` [PATCH v4 5/9] platform/x86: dell-ddv: " Armin Wolf
2026-06-05 19:01 ` sashiko-bot
2026-06-05 18:14 ` [PATCH v4 6/9] hwmon: (dell-smm) " Armin Wolf
2026-06-05 19:06 ` sashiko-bot
2026-06-05 18:14 ` [PATCH v4 7/9] platform/wmi: Make wmi_bus_class const Armin Wolf
2026-06-05 19:08 ` sashiko-bot
2026-06-05 18:14 ` [PATCH v4 8/9] platform/wmi: Make sysfs attributes const Armin Wolf
2026-06-05 19:14 ` sashiko-bot
2026-06-05 18:14 ` [PATCH v4 9/9] modpost: Handle malformed WMI GUID strings Armin Wolf
2026-06-05 19:24 ` sashiko-bot
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=20260605182549.063021F00893@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