Re: [PATCH] platform/x86: asus-wmi: fix use-after-free unregistering kbd_led led
From: Ilpo Järvinen
Date: Wed Sep 16 2026 - 07:16:30 EST
On Tue, 15 Sep 2026 17:26:07 +0000, Denis Benato wrote:
> kbd_led_update_all() registers asus->kbd_led with
> devm_led_classdev_register() on the platform device, but kbd_led is
> embedded in struct asus_wmi, which asus_wmi_remove() frees at its end.
> The driver core calls .remove() before devres_release_all(), so the
> deferred devres release runs led_classdev_unregister() on memory that
> has already been freed. Whether that faults depends on whether the
> slab has been reused in between, which makes the crash on module
> unload intermittent and silently corrupts the led classdev state in
> the remaining runs.
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.
FYI [if applicable to your patch], as per Linus' policy change, also
fixes are mostly routed through for-next unless the fix is for a
commit introduced in the most recent cycle or is clearly a regression
fix.
The list of commits applied:
[1/1] platform/x86: asus-wmi: fix use-after-free unregistering kbd_led led
commit: 2f5005e261ed758254767a32c24587bfacc6db82
--
i.