CVE-2026-98160

staging: rtl8723bs: fix mismatched free of HalData in rtw_sdio_if1_init()

Published Sep 25, 2026 CVSS 3.1 · 5.5 Medium EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

staging: rtl8723bs: fix mismatched free of HalData in rtw_sdio_if1_init()

padapter->HalData is allocated via vzalloc(), but incorrectly freed
using kfree() in the rtw_sdio_if1_init() error path. Using kfree() to
release this vmalloc-backed buffer can lead to memory corruption.

Use rtw_hal_data_deinit() 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 x86_64 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.

Analysis

AI-generated

Technical impact

The Linux kernel staging driver for the Realtek RTL8723BS wireless chipset allocates the HalData structure with vzalloc but frees it with kfree in an error path of rtw_sdio_if1_init(). Using kfree on vmalloc‑backed memory corrupts kernel heap, which can lead to arbitrary code execution or a kernel panic, thereby compromising system availability and integrity. Based on the description, it is inferred that an attacker would need to trigger the driver’s initialization failure, for example by manipulating the SDIO interface or firmware, to exploit this flaw.

Affected Systems

The flaw resides in the rtl8723bs driver that ships with the mainline Linux kernel. Any kernel build that includes this staging driver and enables RTL8723BS SDIO hardware is potentially vulnerable; the issue existed across any release prior to the applied patch.

Risk and Exploitability

The CVSS score of 5.5 indicates moderate severity while the EPSS score of < 1% suggests a low probability of exploitation in the wild. The vulnerability is not listed in CISA’s KEV catalog. Nevertheless, an attacker who can trigger the driver’s initialization failure can cause memory corruption. The vendor fix replaces the incorrect kfree call with rtw_hal_data_deinit() that uses vfree, restoring proper memory management.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the kernel to a version that contains the rtl8723bs driver patch which uses rtw_hal_data_deinit() and vfree() for HalData
  • Disable the rtl8723bs SDIO driver (e.g., blacklist the module or block the device) to prevent the error path from executing until the patch is applied
  • Remove the rtl8723bs driver from the staging tree if the kernel config allows, or disable the SDIO interface in the kernel configuration to avoid using the vulnerable code

Generated by OpenCVE AI on September 30, 2026 at 13:08 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4817-1 linux-6.12 security update
Debian DLA Debian DLA DLA-4841-1 linux security update
Debian DSA Debian DSA DSA-6528-1 linux security update
Ubuntu USN Ubuntu USN USN-8961-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9019-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9020-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9022-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9023-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9024-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9025-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9026-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9029-1 Linux kernel (Raspberry Pi) vulnerabilities
Ubuntu USN Ubuntu USN USN-9039-1 Linux kernel (Azure CVM) vulnerabilities
Ubuntu USN Ubuntu USN USN-9040-1 Linux kernel (Low Latency NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-9066-1 Linux kernel (HWE) vulnerabilities
Ubuntu USN Ubuntu USN USN-9091-1 Linux kernel (NVIDIA Tegra) vulnerabilities
History
Type Values Removed Values Added
Weaknesses CWE-772
Type Values Removed Values Added
Weaknesses CWE-763
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-772
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: staging: rtl8723bs: fix mismatched free of HalData in rtw_sdio_if1_init() padapter->HalData is allocated via vzalloc(), but incorrectly freed using kfree() in the rtw_sdio_if1_init() error path. Using kfree() to release this vmalloc-backed buffer can lead to memory corruption. Use rtw_hal_data_deinit() 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 x86_64 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.
Title staging: rtl8723bs: fix mismatched free of HalData in rtw_sdio_if1_init()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-763

    Release of Invalid Pointer or Reference

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Oct 19, 2026, 9:14 AM
Reserved
Sep 25, 2026, 10:25 AM
Status
Analyzed
Published
Sep 25, 2026, 2:17 PM
Modified
Oct 19, 2026, 10:18 AM
Severity
Moderate
Public date
Sep 25, 2026, 12:00 AM