staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 554c0a3abf216c991c5ebddcdb2c08689ecd290b · < 708056fba733a73d926772ea4ce9a42d240345da| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel's rtl8723bs driver can leak memory when allocation fails in rtw_init_cmd_priv(). The input does not describe how an attacker could trigger the failure or whether network access, authentication, or user interaction is required.
Engineers running the Linux kernel with the rtl8723bs driver should check their installations; affected versions are not specified.