mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: Xueqin Luo <luoxueqin@kylinos.cn>
Cc: ilpo.jarvinen@linux.intel.com,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] platform/x86: wmi: Add ACPI_COMPANION() NULL check in parse_wdg
Date: Tue, 11 Aug 2026 15:44:19 +0200	[thread overview]
Message-ID: <72e66d0d-08cb-4d90-9526-c7acfa614006@gmx.de> (raw)
In-Reply-To: <20260811102128.1027805-1-luoxueqin@kylinos.cn>

Am 11.08.26 um 12:21 schrieb Xueqin Luo:

> Add NULL check for ACPI_COMPANION() in parse_wdg() to prevent NULL
> pointer dereference when driver_override matches a device without
> ACPI companion.
>
> Same issue as CVE-2026-64227.

Hi,

we already perform this check in acpi_wmi_probe(), so doing this again is
not necessary.

Thanks,
Armin Wolf

>
> Fixes: 4186a47dbfbc ("platform/x86: wmi: Decouple probe deferring from wmi_block_list")
> Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
> Cc: stable@vger.kernel.org
> ---
>   drivers/platform/wmi/core.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/wmi/core.c b/drivers/platform/wmi/core.c
> index 529825dcfbfe..151b712d08b5 100644
> --- a/drivers/platform/wmi/core.c
> +++ b/drivers/platform/wmi/core.c
> @@ -1290,7 +1290,7 @@ static int wmi_add_device(struct platform_device *pdev, struct wmi_device *wdev)
>    */
>   static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev)
>   {
> -	struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
> +	struct acpi_device *device;
>   	struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
>   	const struct guid_block *gblock;
>   	bool event_data_available;
> @@ -1300,6 +1300,10 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev)
>   	u32 i, total;
>   	int retval;
>   
> +	device = ACPI_COMPANION(&pdev->dev);
> +	if (!device)
> +		return -ENODEV;
> +
>   	status = acpi_evaluate_object(device->handle, "_WDG", NULL, &out);
>   	if (ACPI_FAILURE(status))
>   		return -ENXIO;

      reply	other threads:[~2026-08-11 13:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 10:21 Xueqin Luo
2026-08-11 13:44 ` Armin Wolf [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=72e66d0d-08cb-4d90-9526-c7acfa614006@gmx.de \
    --to=w_armin@gmx.de \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luoxueqin@kylinos.cn \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®