]> git.ipfire.org Git - thirdparty/linux.git/commit
staging: rtl8723bs: fix potential race in expire_timeout_chk
authorMinu Jin <s9430939@naver.com>
Sat, 31 Jan 2026 17:11:53 +0000 (02:11 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Feb 2026 13:10:04 +0000 (14:10 +0100)
commit02df7c635bd3463abcd92414e32a2cb906089e72
tree71c88838e290f009de94faf5867963a9d5fa68f2
parent8ae0398e70d9d64309708471cf7747097a5f755e
staging: rtl8723bs: fix potential race in expire_timeout_chk

The expire_timeout_chk function currently do lock and unlock inside the
loop before calling rtw_free_stainfo().

This can be risky as the list might be changed
when the lock is briefly released.

To fix this, move expired sta_info entries into a local free_list while
holding the lock, and then perform the actual freeing after the lock is
released.

Signed-off-by: Minu Jin <s9430939@naver.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260131171153.3729458-1-s9430939@naver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_ap.c