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.
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bfc48f1b0505ffcb03a6d749139b7577d6b81ae0",
"id": "CVE-2022-50046-03f1f338",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/sunrpc/sysfs.c"
},
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"199427314492209103650946986433224722655",
"220367509062216270809034746841923416319",
"95545098480799310759911230752079137791",
"106228554847361886763965372380246462193",
"264598348748722233816303893368680174316"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@76fbeb1662b1c56514325118a07fba74dc4c79fe",
"id": "CVE-2022-50046-0d61b432",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "rpc_sysfs_xprt_state_change",
"file": "net/sunrpc/sysfs.c"
},
"signature_type": "Function",
"digest": {
"length": 1411.0,
"function_hash": "325484107837375352069075505036889046100"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c0434f0e058648649250b8ed6078b66d773de723",
"id": "CVE-2022-50046-1dad50fb",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "rpc_sysfs_xprt_state_change",
"file": "net/sunrpc/sysfs.c"
},
"signature_type": "Function",
"digest": {
"length": 1411.0,
"function_hash": "325484107837375352069075505036889046100"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@76fbeb1662b1c56514325118a07fba74dc4c79fe",
"id": "CVE-2022-50046-559d60df",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/sunrpc/sysfs.c"
},
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"199427314492209103650946986433224722655",
"220367509062216270809034746841923416319",
"95545098480799310759911230752079137791",
"106228554847361886763965372380246462193",
"264598348748722233816303893368680174316"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c0434f0e058648649250b8ed6078b66d773de723",
"id": "CVE-2022-50046-7cf3b22b",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/sunrpc/sysfs.c"
},
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"199427314492209103650946986433224722655",
"220367509062216270809034746841923416319",
"95545098480799310759911230752079137791",
"106228554847361886763965372380246462193",
"264598348748722233816303893368680174316"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bfc48f1b0505ffcb03a6d749139b7577d6b81ae0",
"id": "CVE-2022-50046-fb70ecef",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "rpc_sysfs_xprt_state_change",
"file": "net/sunrpc/sysfs.c"
},
"signature_type": "Function",
"digest": {
"length": 912.0,
"function_hash": "212514027748793236120399739624148408505"
}
}
]