From: sashiko-bot@kernel.org
To: "Armin Wolf" <W_Armin@gmx.de>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v4 4/9] platform/x86: dell-wmi-base: Use new buffer-based WMI API
Date: Fri, 05 Jun 2026 18:52:46 +0000 [thread overview]
Message-ID: <20260605185247.3BCCB1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260605181433.188847-5-W_Armin@gmx.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Out-of-bounds memory read in `dell_wmi_process_key()` when processing eprivacy events with short buffers.
--
commit 24a36598ab5922d657cacfad988fd975e31c5cd6
Author: Armin Wolf <W_Armin@gmx.de>
platform/x86: dell-wmi-base: Use new buffer-based WMI API
Use the new buffer-based WMI API to also support ACPI firmware
implementations that do not use ACPI buffers for the event data.
> diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c
> --- a/drivers/platform/x86/dell/dell-wmi-base.c
> +++ b/drivers/platform/x86/dell/dell-wmi-base.c
[ ... ]
> @@ -446,15 +448,15 @@ static int dell_wmi_process_key(struct wmi_device *wdev, int type, int code, u16
> } else if (type == 0x0011 && code == 0xe070 && remaining > 0) {
> dell_wmi_switch_event(&priv->tabletswitch_dev,
> "Dell tablet mode switch",
> - SW_TABLET_MODE, !buffer[0]);
> + SW_TABLET_MODE, !le16_to_cpu(buffer[0]));
> return 1;
> } else if (type == 0x0012 && code == 0x000c && remaining > 0) {
> /* Eprivacy toggle, switch to "on" key entry for on events */
> - if (buffer[0] == 2)
> + if (le16_to_cpu(buffer[0]) == 2)
> key++;
> used = 1;
> } else if (type == 0x0012 && code == 0x000d && remaining > 0) {
> - value = (buffer[2] == 2);
> + value = (le16_to_cpu(buffer[2]) == 2);
[Severity: High]
This is a pre-existing issue, but does this bounds check fully protect
against an out-of-bounds read?
The condition checks if remaining > 0, but the code then accesses buffer[2].
If dell_wmi_notify() encounters an event with len == 4, it will call
dell_wmi_process_key() with a remaining length of 1. This satisfies the
check here, but causes the assignment to read two words past the end of the
WMI event boundary.
Could an unexpectedly short WMI event trigger a page fault here?
> used = 1;
> }
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260605181433.188847-1-W_Armin@gmx.de?part=4
next prev parent reply other threads:[~2026-06-05 18:52 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
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 [this message]
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=20260605185247.3BCCB1F00893@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.