* [PATCH] platform/x86: acer-wmi: fix UAF after accelerometer registration failure
@ 2026-10-26 11:11 Guangshuo Li
2026-10-27 15:33 ` Krzysztof Kozlowski
0 siblings, 1 reply; 3+ messages in thread
From: Guangshuo Li @ 2026-10-26 11:11 UTC (permalink / raw)
To: Lee, Chun-Yi, Hans de Goede, Ilpo Järvinen, Matthew Garrett,
Marek Vasut, platform-driver-x86, linux-kernel
Cc: Guangshuo Li, stable
When input_register_device() fails in acer_wmi_accel_setup(), the error
path frees acer_wmi_accel_dev but leaves the global pointer non-NULL.
Since acer_wmi_init() ignores the accelerometer setup failure and
continues initialization, a later driver removal or initialization
failure can call input_unregister_device() on the dangling pointer,
resulting in a use-after-free.
Set acer_wmi_accel_dev to NULL after freeing it so that the cleanup
paths do not attempt to unregister the already-freed input device.
This issue was found by our static analysis tool under development.
Fixes: 1eb3fe1d3b6b ("ACER: Add support for accelerometer sensor")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
drivers/platform/x86/acer-wmi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 61ae622c93d9..26e17aa04abb 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -2681,6 +2681,7 @@ static int __init acer_wmi_accel_setup(void)
err_free_dev:
input_free_device(acer_wmi_accel_dev);
+ acer_wmi_accel_dev = NULL;
return err;
}
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: acer-wmi: fix UAF after accelerometer registration failure
2026-10-26 11:11 [PATCH] platform/x86: acer-wmi: fix UAF after accelerometer registration failure Guangshuo Li
@ 2026-10-27 15:33 ` Krzysztof Kozlowski
2026-10-27 16:23 ` Guangshuo Li
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2026-10-27 15:33 UTC (permalink / raw)
To: Guangshuo Li, Lee, Chun-Yi, Hans de Goede, Ilpo Järvinen,
Matthew Garrett, Marek Vasut, platform-driver-x86, linux-kernel
Cc: stable
On 26/10/2026 12:11, Guangshuo Li wrote:
> When input_register_device() fails in acer_wmi_accel_setup(), the error
> path frees acer_wmi_accel_dev but leaves the global pointer non-NULL.
>
> Since acer_wmi_init() ignores the accelerometer setup failure and
> continues initialization, a later driver removal or initialization
> failure can call input_unregister_device() on the dangling pointer,
> resulting in a use-after-free.
>
> Set acer_wmi_accel_dev to NULL after freeing it so that the cleanup
> paths do not attempt to unregister the already-freed input device.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: 1eb3fe1d3b6b ("ACER: Add support for accelerometer sensor")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> ---
So you just keep ignoring and ignoring our feedback. It's just bot, so
little point to discuss with bot.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: acer-wmi: fix UAF after accelerometer registration failure
2026-10-27 15:33 ` Krzysztof Kozlowski
@ 2026-10-27 16:23 ` Guangshuo Li
0 siblings, 0 replies; 3+ messages in thread
From: Guangshuo Li @ 2026-10-27 16:23 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Lee, Chun-Yi, Hans de Goede, Ilpo Järvinen, Matthew Garrett,
Marek Vasut, platform-driver-x86, linux-kernel, stable
Hi Krzysztof,
On Tue, 27 Oct 2026 at 23:33, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 26/10/2026 12:11, Guangshuo Li wrote:
> > When input_register_device() fails in acer_wmi_accel_setup(), the error
> > path frees acer_wmi_accel_dev but leaves the global pointer non-NULL.
> >
> > Since acer_wmi_init() ignores the accelerometer setup failure and
> > continues initialization, a later driver removal or initialization
> > failure can call input_unregister_device() on the dangling pointer,
> > resulting in a use-after-free.
> >
> > Set acer_wmi_accel_dev to NULL after freeing it so that the cleanup
> > paths do not attempt to unregister the already-freed input device.
> >
> > This issue was found by our static analysis tool under development.
> >
> > Fixes: 1eb3fe1d3b6b ("ACER: Add support for accelerometer sensor")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> > ---
>
> So you just keep ignoring and ignoring our feedback. It's just bot, so
> little point to discuss with bot.
>
> Best regards,
> Krzysztof
Thank you for your feedback, and I apologize if our recent submissions
gave the impression that we were ignoring your previous comments.
We did take your earlier suggestions into account and subsequently
submitted a patch series accordingly.
For the more recent patches, however, since they address issues in
different drivers, we thought it would be more appropriate to submit
them separately rather than group them into a single series.
We certainly did not intend to disregard your feedback. We appreciate
your time and guidance, and we will be more careful with our future
submissions.
Thank you for your understanding.
Best regards,
Guangshuo Li
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-27 16:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 11:11 [PATCH] platform/x86: acer-wmi: fix UAF after accelerometer registration failure Guangshuo Li
2026-10-27 15:33 ` Krzysztof Kozlowski
2026-10-27 16:23 ` Guangshuo Li
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®