All of lore.kernel.org
 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 v4 2/9] platform/x86: dell-privacy: Use new buffer-based WMI API
Date: Fri, 05 Jun 2026 18:35:50 +0000	[thread overview]
Message-ID: <20260605183551.01B281F0089A@smtp.kernel.org> (raw)
In-Reply-To: <20260605181433.188847-3-W_Armin@gmx.de>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Accessing `priv->features_present` outside of `list_mutex` allows a use-after-free if the WMI device is concurrently unbound.
--

commit a3ad83ddca7fe7cc3bab34b78212f157c5a62096
Author: Armin Wolf <W_Armin@gmx.de>

platform/x86: dell-privacy: Use new buffer-based WMI API

This commit updates the dell-privacy driver to use the new buffer-based
WMI API. This allows it to support ACPI firmware implementations that do
not use ACPI buffers for the device state.

> diff --git a/drivers/platform/x86/dell/dell-wmi-privacy.c b/drivers/platform/x86/dell/dell-wmi-privacy.c
> index ed099a431ea4d..7bc1bae3a196f 100644
> --- a/drivers/platform/x86/dell/dell-wmi-privacy.c
> +++ b/drivers/platform/x86/dell/dell-wmi-privacy.c

[ ... ]

While reviewing this file, I noticed a pre-existing issue in
dell_privacy_has_mic_mute().

drivers/platform/x86/dell/dell-wmi-privacy.c:dell_privacy_has_mic_mute() {
    ...
	mutex_lock(&list_mutex);
	priv = list_first_entry_or_null(&wmi_list,
			struct privacy_wmi_data,
			list);
	mutex_unlock(&list_mutex);

	return priv && (priv->features_present & BIT(DELL_PRIVACY_TYPE_AUDIO));
}

[Severity: High]
This is a pre-existing issue and was not introduced by this patch, but
could accessing priv->features_present outside of list_mutex allow a
use-after-free?

If the dell-privacy WMI device is concurrently unbound,
dell_privacy_wmi_remove() will acquire list_mutex, remove priv from the
list, and unlock it.

After remove() returns, the device management framework automatically
frees the priv memory since it was allocated with devm_kzalloc().

If dell_privacy_has_mic_mute() unlocks the mutex and is preempted before
returning, would it dereference the priv pointer after it has been freed?

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

  reply	other threads:[~2026-06-05 18:35 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 [this message]
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=20260605183551.01B281F0089A@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.