public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: "Kurt Borja" <kuurtb@gmail.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/wmi: Fix unchecked min_size in wmidev_invoke_method()
Date: Wed, 29 Apr 2026 23:47:46 +0200	[thread overview]
Message-ID: <824480ce-99d3-437f-bcae-ad2a1f286803@gmx.de> (raw)
In-Reply-To: <20260429-invoke-fix-v1-1-ce938eb80cd3@gmail.com>

Am 29.04.26 um 15:20 schrieb Kurt Borja:

> After calling wmidev_evaluate_method(), if the ACPI core does not return
> an out object, then wmidev_invoke_method() bypasses the min_size check
> and returns 0. Add a check for min_size if there is not an out object.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>

> Fixes: 1aeded2f55f0 ("platform/wmi: Extend wmidev_query_block() to reject undersized data")
> Closes: https://sashiko.dev/#/patchset/20260406203237.2970-1-W_Armin%40gmx.de
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
>   drivers/platform/wmi/core.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/platform/wmi/core.c b/drivers/platform/wmi/core.c
> index 7aa40dab6145..5a2ffcbab6af 100644
> --- a/drivers/platform/wmi/core.c
> +++ b/drivers/platform/wmi/core.c
> @@ -411,6 +411,9 @@ int wmidev_invoke_method(struct wmi_device *wdev, u8 instance, u32 method_id,
>   
>   	obj = aout.pointer;
>   	if (!obj) {
> +		if (min_size != 0)
> +			return -ENOMSG;
> +
>   		out->length = 0;
>   		out->data = ZERO_SIZE_PTR;
>   
>
> ---
> base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
> change-id: 20260429-invoke-fix-44f026f90c56
>

  reply	other threads:[~2026-04-29 21:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 13:20 [PATCH] platform/wmi: Fix unchecked min_size in wmidev_invoke_method() Kurt Borja
2026-04-29 21:47 ` Armin Wolf [this message]
2026-04-30 13:54 ` Ilpo Järvinen

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=824480ce-99d3-437f-bcae-ad2a1f286803@gmx.de \
    --to=w_armin@gmx.de \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kuurtb@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@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