In the Linux kernel, the following vulnerability has been resolved:
staging: rtl8723bs: fix a potential memory leak in rtwinitcmd_priv()
In rtwinitcmd_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
rtwinitcmd_priv(). As there is no proper device to test with, no runtime
testing was performed.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50513.json",
"cna_assigner": "Linux"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50513.json"
[
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "173655720580508385812187985222163371263",
"length": 850.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e5d8f05edb36fc4ab15beec62cb6ab62f5a60fe2",
"signature_type": "Function",
"id": "CVE-2022-50513-16d3c960",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c",
"function": "rtw_init_cmd_priv"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "21496042621481207567526770795224032823",
"length": 858.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e6cc39db24a63f68314473621020ed8cad7be423",
"signature_type": "Function",
"id": "CVE-2022-50513-2a8ced57",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c",
"function": "rtw_init_cmd_priv"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "21496042621481207567526770795224032823",
"length": 858.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@39bef9c6a91bbb790d04c1347cfeae584541fb6a",
"signature_type": "Function",
"id": "CVE-2022-50513-711ada1d",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c",
"function": "rtw_init_cmd_priv"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "64787218371549874051539246683180581878",
"length": 905.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a5be64ff6d21f7805a91e6d81f53fc19cd9f0fae",
"signature_type": "Function",
"id": "CVE-2022-50513-711c2436",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c",
"function": "rtw_init_cmd_priv"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"163568139421943641022756090053074056799",
"308097464636009114148236872308260942616",
"191421171961613782691307090666830512646",
"85539410867340559617614260116031765508",
"302257342028957776449870258584790847931",
"227831054940734939709400324668134121609",
"204794552682503719212129039132206731307",
"331977738367129830542724845892698649552",
"15893305288815602633551181507911897256",
"112832905912772483448671254000809821127",
"153106302121360915001789546847849249832",
"175772564738968233224340962079719163081",
"282924805657788799971510439491671337814",
"325744683552229868903740245409516475265",
"229016250221536477729176595889147099523",
"88948500242236955741747851391117026559",
"243254399118248494367555760079789819664",
"37059841424355500179705102578276967205",
"73540661927781801385536409037176731064",
"196982509644897359492215106305046154328",
"71112036771199461901843428502516150257"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a5be64ff6d21f7805a91e6d81f53fc19cd9f0fae",
"signature_type": "Line",
"id": "CVE-2022-50513-7671dfb0",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"163568139421943641022756090053074056799",
"308097464636009114148236872308260942616",
"191421171961613782691307090666830512646",
"85539410867340559617614260116031765508",
"302257342028957776449870258584790847931",
"227831054940734939709400324668134121609",
"204794552682503719212129039132206731307",
"331977738367129830542724845892698649552",
"15893305288815602633551181507911897256",
"112832905912772483448671254000809821127",
"153106302121360915001789546847849249832",
"175772564738968233224340962079719163081",
"282924805657788799971510439491671337814",
"325744683552229868903740245409516475265",
"229016250221536477729176595889147099523",
"88948500242236955741747851391117026559",
"243254399118248494367555760079789819664",
"37059841424355500179705102578276967205",
"73540661927781801385536409037176731064",
"196982509644897359492215106305046154328",
"71112036771199461901843428502516150257"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8db6ca84eee0ac258706f3fca54f7c021cb159ef",
"signature_type": "Line",
"id": "CVE-2022-50513-94ed8554",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"163568139421943641022756090053074056799",
"308097464636009114148236872308260942616",
"191421171961613782691307090666830512646",
"85539410867340559617614260116031765508",
"302257342028957776449870258584790847931",
"227831054940734939709400324668134121609",
"204794552682503719212129039132206731307",
"331977738367129830542724845892698649552",
"15893305288815602633551181507911897256",
"112832905912772483448671254000809821127",
"153106302121360915001789546847849249832",
"175772564738968233224340962079719163081",
"282924805657788799971510439491671337814",
"325744683552229868903740245409516475265",
"229016250221536477729176595889147099523",
"88948500242236955741747851391117026559",
"243254399118248494367555760079789819664",
"37059841424355500179705102578276967205",
"73540661927781801385536409037176731064",
"196982509644897359492215106305046154328",
"71112036771199461901843428502516150257"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@708056fba733a73d926772ea4ce9a42d240345da",
"signature_type": "Line",
"id": "CVE-2022-50513-c34b2d7d",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"163568139421943641022756090053074056799",
"308097464636009114148236872308260942616",
"191421171961613782691307090666830512646",
"188327213291767803080778665477849999028",
"183707542281389804236307193747987853941",
"227831054940734939709400324668134121609",
"204794552682503719212129039132206731307",
"331977738367129830542724845892698649552",
"15893305288815602633551181507911897256",
"112832905912772483448671254000809821127",
"153106302121360915001789546847849249832",
"175772564738968233224340962079719163081",
"282924805657788799971510439491671337814",
"325744683552229868903740245409516475265",
"229016250221536477729176595889147099523",
"88948500242236955741747851391117026559",
"243254399118248494367555760079789819664",
"37059841424355500179705102578276967205",
"73540661927781801385536409037176731064",
"100309750693854041347637713305776969688",
"25486191312515523839090792117488393412"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e6cc39db24a63f68314473621020ed8cad7be423",
"signature_type": "Line",
"id": "CVE-2022-50513-c6cedd03",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"163568139421943641022756090053074056799",
"308097464636009114148236872308260942616",
"191421171961613782691307090666830512646",
"188327213291767803080778665477849999028",
"183707542281389804236307193747987853941",
"227831054940734939709400324668134121609",
"204794552682503719212129039132206731307",
"331977738367129830542724845892698649552",
"15893305288815602633551181507911897256",
"112832905912772483448671254000809821127",
"153106302121360915001789546847849249832",
"175772564738968233224340962079719163081",
"282924805657788799971510439491671337814",
"325744683552229868903740245409516475265",
"229016250221536477729176595889147099523",
"209745155915634387060067852254488696290",
"137262441540970336803301325117753725474",
"32938284498837608193795969255158215572",
"73540661927781801385536409037176731064",
"100309750693854041347637713305776969688",
"25486191312515523839090792117488393412"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e5d8f05edb36fc4ab15beec62cb6ab62f5a60fe2",
"signature_type": "Line",
"id": "CVE-2022-50513-d4ce26f3",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "64787218371549874051539246683180581878",
"length": 905.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8db6ca84eee0ac258706f3fca54f7c021cb159ef",
"signature_type": "Function",
"id": "CVE-2022-50513-d70d5d9a",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c",
"function": "rtw_init_cmd_priv"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"163568139421943641022756090053074056799",
"308097464636009114148236872308260942616",
"191421171961613782691307090666830512646",
"188327213291767803080778665477849999028",
"183707542281389804236307193747987853941",
"227831054940734939709400324668134121609",
"204794552682503719212129039132206731307",
"331977738367129830542724845892698649552",
"15893305288815602633551181507911897256",
"112832905912772483448671254000809821127",
"153106302121360915001789546847849249832",
"175772564738968233224340962079719163081",
"282924805657788799971510439491671337814",
"325744683552229868903740245409516475265",
"229016250221536477729176595889147099523",
"88948500242236955741747851391117026559",
"243254399118248494367555760079789819664",
"37059841424355500179705102578276967205",
"73540661927781801385536409037176731064",
"196982509644897359492215106305046154328",
"71112036771199461901843428502516150257"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@39bef9c6a91bbb790d04c1347cfeae584541fb6a",
"signature_type": "Line",
"id": "CVE-2022-50513-daa6a4dc",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "64787218371549874051539246683180581878",
"length": 905.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@708056fba733a73d926772ea4ce9a42d240345da",
"signature_type": "Function",
"id": "CVE-2022-50513-e071c86a",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_cmd.c",
"function": "rtw_init_cmd_priv"
}
}
]