platform/wmi: Fix unchecked min_size in wmidev_invoke_method()
Subsystems (2)
PATCH 1/1 platform/wmi: Fix unchecked min_size in wmidev_invoke_method()
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.
--- drivers/platform/wmi/core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/platform/wmi/core.c +3 -0
@@ -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
Signature · 2 lines
Thanks, ~ Kurt
Am 29.04.26 um 15:20 schrieb Kurt Borja:
Quoted 3 lines
After calling
wmidev_evaluate_method(), if the ACPI core does not return an out object, thenwmidev_invoke_method()bypasses themin_sizecheck and returns 0. Add a check formin_sizeif there is not an out object.
Quoted 26 lines
Fixes 1aeded2f55f0 ("platform/wmi: Extend wmidev_query_block() to reject undersized data")Signed-off-by Kurt Borja <[email protected]>--- drivers/platform/wmi/core.c | 3 +++ 1 file changed, 3 insertions(+)drivers/platform/wmi/core.c +3
-1@@ -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
Ilpo Järvinen
maintainerQuoted 5 lines · Kurt Borja
After calling
wmidev_evaluate_method(), if the ACPI core does not return an out object, thenwmidev_invoke_method()bypasses themin_sizecheck and returns 0. Add a check formin_sizeif there is not an out object.
Thank you for your contribution, it has been applied to my local review-ilpo-fixes branch. Note it will show up in the public platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my local branch there, which might take a while.
The list of commits applied:
[1/1] platform/wmi: Fix unchecked min_size in wmidev_invoke_method()
commit: d3b7a868f1aeb6a43de880a3709ef3a0341f2c2a
--
i.