In the Linux kernel, the following vulnerability has been resolved:
usb: usbip: fix a refcount leak in stub_probe()
usbgetdev() is called in stubdevicealloc(). When stubprobe() fails after that, usbput_dev() needs to be called to release the reference.
Fix this by moving usbputdev() to sdev_free error path handling.
Find this by code review.
[
{
"id": "CVE-2022-49389-0a743520",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@247d3809e45a34d9e1a3a2bb7012e31ed8b46031",
"digest": {
"length": 1890.0,
"function_hash": "303838437510503848486455673226288198615"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "stub_probe",
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-1d003e1a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6bafee2f18af5e5ac125e42960bc65496d0e56a0",
"digest": {
"length": 1890.0,
"function_hash": "303838437510503848486455673226288198615"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "stub_probe",
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-20b7f02b",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6bafee2f18af5e5ac125e42960bc65496d0e56a0",
"digest": {
"line_hashes": [
"188122468719080928348857451209532560213",
"87278530410663368061962561687056580640",
"205363438712346673184459102926553083202",
"324503868310660336186298831158825415287",
"9331991689213032564909124614493191840",
"323221380149215081741094709122647791979",
"84287992761788844456373091956178586118",
"294850170379408004195904228864840966912"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-4f9e86c3",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2f0ae93ec33c8456cdfbf7876b80403a6318ebce",
"digest": {
"line_hashes": [
"169602301072493225392631492625043893323",
"87278530410663368061962561687056580640",
"205363438712346673184459102926553083202",
"324503868310660336186298831158825415287",
"9331991689213032564909124614493191840",
"323221380149215081741094709122647791979",
"84287992761788844456373091956178586118",
"294850170379408004195904228864840966912"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-659b0a0f",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@247d3809e45a34d9e1a3a2bb7012e31ed8b46031",
"digest": {
"line_hashes": [
"188122468719080928348857451209532560213",
"87278530410663368061962561687056580640",
"205363438712346673184459102926553083202",
"324503868310660336186298831158825415287",
"9331991689213032564909124614493191840",
"323221380149215081741094709122647791979",
"84287992761788844456373091956178586118",
"294850170379408004195904228864840966912"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-6cea86a5",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@51422046be504515eb5a591adf0f424b62f46804",
"digest": {
"length": 1676.0,
"function_hash": "43847876506402071367236847168217937794"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "stub_probe",
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-720b4f64",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8afb048800919d0ab10c57983940eba956339f21",
"digest": {
"line_hashes": [
"169602301072493225392631492625043893323",
"87278530410663368061962561687056580640",
"205363438712346673184459102926553083202",
"324503868310660336186298831158825415287",
"9331991689213032564909124614493191840",
"323221380149215081741094709122647791979",
"84287992761788844456373091956178586118",
"294850170379408004195904228864840966912"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-79d6c6c5",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@51422046be504515eb5a591adf0f424b62f46804",
"digest": {
"line_hashes": [
"169602301072493225392631492625043893323",
"87278530410663368061962561687056580640",
"205363438712346673184459102926553083202",
"324503868310660336186298831158825415287",
"9331991689213032564909124614493191840",
"323221380149215081741094709122647791979",
"84287992761788844456373091956178586118",
"294850170379408004195904228864840966912"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-8d8c6b2a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2f0ae93ec33c8456cdfbf7876b80403a6318ebce",
"digest": {
"length": 1676.0,
"function_hash": "43847876506402071367236847168217937794"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "stub_probe",
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-97f27ff6",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f20d2d3b3364ce6525c050a8b6b4c54c8c19674d",
"digest": {
"length": 1890.0,
"function_hash": "303838437510503848486455673226288198615"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "stub_probe",
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-9ab02338",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8afb048800919d0ab10c57983940eba956339f21",
"digest": {
"length": 1676.0,
"function_hash": "43847876506402071367236847168217937794"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "stub_probe",
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-a4ef6b2c",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bcbb795a9e78180d74c6ab21518da87e803dfdce",
"digest": {
"line_hashes": [
"169602301072493225392631492625043893323",
"87278530410663368061962561687056580640",
"205363438712346673184459102926553083202",
"324503868310660336186298831158825415287",
"9331991689213032564909124614493191840",
"323221380149215081741094709122647791979",
"84287992761788844456373091956178586118",
"294850170379408004195904228864840966912"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-b4ebef11",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ec4cbf1cc55d126759051acfe328d489c5d6e60",
"digest": {
"length": 1676.0,
"function_hash": "43847876506402071367236847168217937794"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "stub_probe",
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-bc288a21",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ec4cbf1cc55d126759051acfe328d489c5d6e60",
"digest": {
"line_hashes": [
"169602301072493225392631492625043893323",
"87278530410663368061962561687056580640",
"205363438712346673184459102926553083202",
"324503868310660336186298831158825415287",
"9331991689213032564909124614493191840",
"323221380149215081741094709122647791979",
"84287992761788844456373091956178586118",
"294850170379408004195904228864840966912"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-bedc9adb",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11c65408bd0ba1d9cd1307caa38169292de9cdfb",
"digest": {
"length": 1676.0,
"function_hash": "43847876506402071367236847168217937794"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "stub_probe",
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-c2687e47",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f20d2d3b3364ce6525c050a8b6b4c54c8c19674d",
"digest": {
"line_hashes": [
"188122468719080928348857451209532560213",
"87278530410663368061962561687056580640",
"205363438712346673184459102926553083202",
"324503868310660336186298831158825415287",
"9331991689213032564909124614493191840",
"323221380149215081741094709122647791979",
"84287992761788844456373091956178586118",
"294850170379408004195904228864840966912"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-d41d90f7",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11c65408bd0ba1d9cd1307caa38169292de9cdfb",
"digest": {
"line_hashes": [
"169602301072493225392631492625043893323",
"87278530410663368061962561687056580640",
"205363438712346673184459102926553083202",
"324503868310660336186298831158825415287",
"9331991689213032564909124614493191840",
"323221380149215081741094709122647791979",
"84287992761788844456373091956178586118",
"294850170379408004195904228864840966912"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "drivers/usb/usbip/stub_dev.c"
}
},
{
"id": "CVE-2022-49389-daa70375",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bcbb795a9e78180d74c6ab21518da87e803dfdce",
"digest": {
"length": 1676.0,
"function_hash": "43847876506402071367236847168217937794"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "stub_probe",
"file": "drivers/usb/usbip/stub_dev.c"
}
}
]