CVE-2022-50513

staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()

MEDIUM
5.5
CVSS Score
Published: October 7, 2025 at 03:19 PM UTC
Updated: June 17, 2026 at 05:23 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%

Description

In the Linux kernel, the following vulnerability has been resolved: staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv() In rtw_init_cmd_priv(), if `pcmdpriv->rsp_allocated_buf` is allocated in failure, then `pcmdpriv->cmd_allocated_buf` will be not properly released. Besides, considering there are only two error paths and the first one can directly return, so we do not need implicitly jump to the `exit` tag to execute the error handler. So this patch added `kfree(pcmdpriv->cmd_allocated_buf);` on the error path to release the resource and simplified the return logic of rtw_init_cmd_priv(). As there is no proper device to test with, no runtime testing was performed.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

4.12 ≤ v < 5.10.1504.12 ≤ v < 5.15.754.12 ≤ v < 5.19.174.12 ≤ v < 5.4.2204.12 ≤ v < 6.0.34.12 ≤ v < 6.15.11 ≤ v < 5.15.755.16 ≤ v < 5.19.175.5 ≤ v < 5.10.1506.0 ≤ v < 6.0.34.12554c0a3abf216c991c5ebddcdb2c08689ecd290b
Vendor states this is fixed in 39bef9c6a91bbb790d04c1347cfeae584541fb6a (fixed)
Vendor states this is fixed in 708056fba733a73d926772ea4ce9a42d240345da (fixed)
Vendor states this is fixed in 8db6ca84eee0ac258706f3fca54f7c021cb159ef (fixed)
Vendor states this is fixed in a5be64ff6d21f7805a91e6d81f53fc19cd9f0fae (fixed)
Vendor states this is fixed in e5d8f05edb36fc4ab15beec62cb6ab62f5a60fe2 (fixed)
Vendor states this is fixed in e6cc39db24a63f68314473621020ed8cad7be423 (fixed)
Vendor states this is fixed in 4.12 (unaffected)
Vendor states this is fixed in 5.10.150 (unaffected)
Vendor states this is fixed in 5.15.75 (unaffected)
Vendor states this is fixed in 5.19.17 (unaffected)
Vendor states this is fixed in 5.4.220 (unaffected)
Vendor states this is fixed in 6.0.3 (unaffected)
Vendor states this is fixed in 6.1 (unaffected)

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-401

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card