CVE-2022-50513 staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()

Medium 5.5 Published Updated

A memory leak in the rtl8723bs staging driver can lead to resource exhaustion and denial of service.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-50513?

CVE-2022-50513 is a medium-severity denial of service vulnerability in Linux kernel, published on 7 Oct 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Weakness: CWE-401

Which versions are affected by CVE-2022-50513?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-50513?

Apply the vendor's patch.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2022-50513 being exploited?

There is no known exploitation of CVE-2022-50513 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-50513, GHSA-vvwr-r28w-f48x, UBUNTU-CVE-2022-50513.

Is CVE-2022-50513 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free