CVE-2022-50046: net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change()
In the Linux kernel, the following vulnerability has been resolved:
net/sunrpc: fix potential memory leaks in rpcsysfsxprtstatechange()
The issue happens on some error handling paths. When the function fails to grab the object xprt, it simply returns 0, forgetting to decrease the reference count of another object xps, which is increased by rpcsysfsxprtkobjgetxprtswitch(), causing refcount leaks. Also, the function forgets to check whether xps is valid before using it, which may result in NULL-dereferencing issues.
Fix it by adding proper error handling code when either xprt or xps is NULL.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-aws-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1023.27~20.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1023.29~20.04.1 - Upgrade
Upgrade
ubuntu/linux-gcp-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1022.29~20.04.1 - Upgrade
Upgrade
ubuntu/linux-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-53.59~20.04.1 - Upgrade
Upgrade
ubuntu/linux-intel-iotg-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1018.23~20.04.1 - Upgrade
Upgrade
ubuntu/linux-lowlatency-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-53.59~20.04.1 - Upgrade
Upgrade
ubuntu/linux-oracle-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1022.28~20.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1023.27~20.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.15.0-53.59 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.15.0-1023.27 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 5.15.0-1023.29 - Upgrade
Upgrade
ubuntu/linux-azure-fdeto a version that resolves this vulnerability.Fixed in 5.15.0-1024.30.1 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.15.0-1022.29 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 5.15.0-1020.25 - Upgrade
Upgrade
ubuntu/linux-gkeopto a version that resolves this vulnerability.Fixed in 5.15.0-1008.12 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.15.0-1018.21 - Upgrade
Upgrade
ubuntu/linux-intel-iotgto a version that resolves this vulnerability.Fixed in 5.15.0-1018.23 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.15.0-1021.26 - Upgrade
Upgrade
ubuntu/linux-lowlatencyto a version that resolves this vulnerability.Fixed in 5.15.0-53.59 - Upgrade
Upgrade
ubuntu/linux-nvidiato a version that resolves this vulnerability.Fixed in 5.15.0-1015.15 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.15.0-1022.28 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 5.15.0-1018.20 - Upgrade
Upgrade
ubuntu/linux-realtimeto a version that resolves this vulnerability.Fixed in 5.15.0-1025.28 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.0.2-1 - Compensating control
In net/sunrpc's rpc_sysfs_xprt_state_change(), add NULL checks and error handling when either xprt or xps is NULL; if grabbing xprt fails, decrement the xps reference count acquired by rpc_sysfs_xprt_kobj_get_xprt_switch().
Event History
Frequently Asked Questions
What is the severity of CVE-2022-50046?
CVE-2022-50046 has a medium severity rating due to potential memory leaks in specific error handling paths.
How do I fix CVE-2022-50046?
To fix CVE-2022-50046, update to the latest Linux kernel version that addresses this vulnerability.
What versions of the Linux kernel are affected by CVE-2022-50046?
CVE-2022-50046 affects Linux kernel versions 5.14 to 5.15.63 and 5.16 to 5.19.4, as well as 6.0-rc1.
What is the nature of the vulnerability in CVE-2022-50046?
The vulnerability in CVE-2022-50046 involves potential memory leaks due to improper error handling in the rpc_sysfs_xprt_state_change function.
Is CVE-2022-50046 related to remote code execution?
CVE-2022-50046 is not directly related to remote code execution, but it does pose a risk due to memory management issues.