]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: rsi: fix kthread lifetime race between self-exit and external-stop
authorJeongjun Park <aha310510@gmail.com>
Wed, 22 Apr 2026 17:38:46 +0000 (02:38 +0900)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 28 Apr 2026 08:40:52 +0000 (10:40 +0200)
commitdb57a1aa54ff68669781976e4edb045e09e2b65b
tree585fae674e284cd62d244648f842e2c99323db9a
parent7a5b81e0c87a075afd572f659d8eb68c9c4cd2ba
wifi: rsi: fix kthread lifetime race between self-exit and external-stop

RSI driver use both self-exit(kthread_complete_and_exit) and external-stop
(kthread_stop) when killing a kthread. Generally, kthread_stop() is called
first, and in this case, no particular issues occur.

However, in rare instances where kthread_complete_and_exit() is called
first and then kthread_stop() is called, a UAF occurs because the kthread
object, which has already exited and been freed, is accessed again.

Therefore, to prevent this with minimal modification, you must remove
kthread_stop() and change the code to wait until the self-exit operation
is completed.

Cc: <stable@vger.kernel.org>
Reported-by: syzbot+5de83f57cd8531f55596@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/69e5d03b.a00a0220.1bd0ca.0064.GAE@google.com/
Fixes: 4c62764d0fc2 ("rsi: improve kernel thread handling to fix kernel panic")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
Link: https://patch.msgid.link/20260422173846.37640-1-aha310510@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/rsi/rsi_common.h