CVE-2026-98160: staging: rtl8723bs: fix mismatched free of HalData in rtw_sdio_if1_init()
In the Linux kernel, the following vulnerability has been resolved:
staging: rtl8723bs: fix mismatched free of HalData in rtwsdioif1init()
padapter->HalData is allocated via vzalloc(), but incorrectly freed using kfree() in the rtwsdioif1init() error path. Using kfree() to release this vmalloc-backed buffer can lead to memory corruption.
Use rtwhaldatadeinit() to pair the free correctly and free HalData with vfree().
The bug was first flagged by an experimental static analysis tool we are developing for kernel memory-management bugs. Manual inspection confirms that the issue is still present in current mainline.
An x8664 allyesconfig build showed no new warnings. As we do not have suitable RTL8723BS SDIO hardware to test with, no runtime testing was able to be performed.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
The issue is in the Linux kernel's RTL8723BS SDIO driver. It is relevant when that driver's rtw_sdio_if1_init() initialization path is used.
What condition triggers the vulnerable behavior?
The problem occurs on an error path in rtw_sdio_if1_init() after HalData has been allocated with vzalloc(). That path incorrectly releases the vmalloc-backed allocation with kfree(), which can cause memory corruption.
Was the fix runtime-tested on affected hardware?
No suitable RTL8723BS SDIO hardware was available, so runtime testing was not performed. The issue was identified by static analysis and confirmed by manual inspection; an x86_64 allyesconfig build produced no new warnings.