In the Linux kernel, the following vulnerability has been resolved:
scsi: mpt3sas: Fix possible resource leaks in mpt3sastransportport_add()
In mpt3sastransportportadd(), if sasrphyadd() returns error, sasrphyfree() needs be called to free the resource allocated in sasenddevicealloc(). Otherwise a kernel crash will happen:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000108 CPU: 45 PID: 37020 Comm: bash Kdump: loaded Tainted: G W 6.1.0-rc1+ #189 pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : devicedel+0x54/0x3d0 lr : devicedel+0x37c/0x3d0 Call trace: devicedel+0x54/0x3d0 attributecontainerclassdevicedel+0x28/0x38 transportremoveclassdev+0x6c/0x80 attributecontainerdevicetrigger+0x108/0x110 transportremovedevice+0x28/0x38 sasrphyremove+0x50/0x78 [scsitransportsas] sasportdelete+0x30/0x148 [scsitransportsas] dosasphydelete+0x78/0x80 [scsitransportsas] deviceforeachchild+0x68/0xb0 sasremovechildren+0x30/0x50 [scsitransportsas] sasrphyremove+0x38/0x78 [scsitransportsas] sasportdelete+0x30/0x148 [scsitransportsas] dosasphydelete+0x78/0x80 [scsitransportsas] deviceforeachchild+0x68/0xb0 sasremovechildren+0x30/0x50 [scsitransportsas] sasremovehost+0x20/0x38 [scsitransportsas] scsih_remove+0xd8/0x420 [mpt3sas]
Because transportadddevice() is not called when sasrphyadd() fails, the device is not added. When sasrphyremove() is subsequently called to remove the device in the remove() path, a NULL pointer dereference happens.
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6f6768e2fc8638fabdd8802c2ef693d7aef01db1",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-0f2ea1e9",
"target": {
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"51088543631541815255510634240521841812",
"62772216414341719455301012366817122865",
"217290918586252574093187918029339325138",
"31454417550747113380575455147823603781"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ce1a69cc85006b494353911b35171da195d79e25",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-10342e6d",
"target": {
"function": "mpt3sas_transport_port_add",
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Function",
"digest": {
"length": 3574.0,
"function_hash": "237138755303237177281779486391494563668"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d17bca3ddfe507874cb826d32721552da12e741f",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-405e8259",
"target": {
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"51088543631541815255510634240521841812",
"62772216414341719455301012366817122865",
"217290918586252574093187918029339325138",
"31454417550747113380575455147823603781"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6a92129c8f999ff5b122c100ce7f625eb3e98c4b",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-5fdb6c85",
"target": {
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"51088543631541815255510634240521841812",
"62772216414341719455301012366817122865",
"217290918586252574093187918029339325138",
"31454417550747113380575455147823603781"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ce1a69cc85006b494353911b35171da195d79e25",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-70bebe6d",
"target": {
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"13213490233849292444201300456081385207",
"62772216414341719455301012366817122865",
"217290918586252574093187918029339325138",
"31454417550747113380575455147823603781"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d60000cb1195a464080b0efb4949daf7594e0020",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-737bbc95",
"target": {
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"13213490233849292444201300456081385207",
"62772216414341719455301012366817122865",
"217290918586252574093187918029339325138",
"31454417550747113380575455147823603781"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6a92129c8f999ff5b122c100ce7f625eb3e98c4b",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-7cf5e814",
"target": {
"function": "mpt3sas_transport_port_add",
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Function",
"digest": {
"length": 4417.0,
"function_hash": "1010587518462080836612299698749052013"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@78316e9dfc24906dd474630928ed1d3c562b568e",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-ab49bea7",
"target": {
"function": "mpt3sas_transport_port_add",
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Function",
"digest": {
"length": 4417.0,
"function_hash": "1010587518462080836612299698749052013"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d17bca3ddfe507874cb826d32721552da12e741f",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-c260c864",
"target": {
"function": "mpt3sas_transport_port_add",
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Function",
"digest": {
"length": 4417.0,
"function_hash": "1010587518462080836612299698749052013"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d60000cb1195a464080b0efb4949daf7594e0020",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-c59da619",
"target": {
"function": "mpt3sas_transport_port_add",
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Function",
"digest": {
"length": 3642.0,
"function_hash": "241088551587400600626572151866407566444"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@78316e9dfc24906dd474630928ed1d3c562b568e",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-db3ce102",
"target": {
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"51088543631541815255510634240521841812",
"62772216414341719455301012366817122865",
"217290918586252574093187918029339325138",
"31454417550747113380575455147823603781"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6f6768e2fc8638fabdd8802c2ef693d7aef01db1",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2022-50532-fbefeee5",
"target": {
"function": "mpt3sas_transport_port_add",
"file": "drivers/scsi/mpt3sas/mpt3sas_transport.c"
},
"signature_type": "Function",
"digest": {
"length": 4417.0,
"function_hash": "1010587518462080836612299698749052013"
}
}
]