{"id":"CVE-2022-50532","summary":"scsi: mpt3sas: Fix possible resource leaks in mpt3sas_transport_port_add()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: mpt3sas: Fix possible resource leaks in mpt3sas_transport_port_add()\n\nIn mpt3sas_transport_port_add(), if sas_rphy_add() returns error,\nsas_rphy_free() needs be called to free the resource allocated in\nsas_end_device_alloc(). Otherwise a kernel crash will happen:\n\nUnable to handle kernel NULL pointer dereference at virtual address 0000000000000108\nCPU: 45 PID: 37020 Comm: bash Kdump: loaded Tainted: G        W          6.1.0-rc1+ #189\npstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)\npc : device_del+0x54/0x3d0\nlr : device_del+0x37c/0x3d0\nCall trace:\n device_del+0x54/0x3d0\n attribute_container_class_device_del+0x28/0x38\n transport_remove_classdev+0x6c/0x80\n attribute_container_device_trigger+0x108/0x110\n transport_remove_device+0x28/0x38\n sas_rphy_remove+0x50/0x78 [scsi_transport_sas]\n sas_port_delete+0x30/0x148 [scsi_transport_sas]\n do_sas_phy_delete+0x78/0x80 [scsi_transport_sas]\n device_for_each_child+0x68/0xb0\n sas_remove_children+0x30/0x50 [scsi_transport_sas]\n sas_rphy_remove+0x38/0x78 [scsi_transport_sas]\n sas_port_delete+0x30/0x148 [scsi_transport_sas]\n do_sas_phy_delete+0x78/0x80 [scsi_transport_sas]\n device_for_each_child+0x68/0xb0\n sas_remove_children+0x30/0x50 [scsi_transport_sas]\n sas_remove_host+0x20/0x38 [scsi_transport_sas]\n scsih_remove+0xd8/0x420 [mpt3sas]\n\nBecause transport_add_device() is not called when sas_rphy_add() fails, the\ndevice is not added. When sas_rphy_remove() is subsequently called to\nremove the device in the remove() path, a NULL pointer dereference happens.","modified":"2026-03-20T12:22:35.241329Z","published":"2025-10-07T15:19:22.581Z","related":["SUSE-SU-2025:4111-1","SUSE-SU-2025:4135-1","SUSE-SU-2025:4139-1","SUSE-SU-2025:4149-1","SUSE-SU-2025:4188-1","SUSE-SU-2025:4189-1","SUSE-SU-2025:4320-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50532.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/6a92129c8f999ff5b122c100ce7f625eb3e98c4b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6f6768e2fc8638fabdd8802c2ef693d7aef01db1"},{"type":"WEB","url":"https://git.kernel.org/stable/c/78316e9dfc24906dd474630928ed1d3c562b568e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ce1a69cc85006b494353911b35171da195d79e25"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d17bca3ddfe507874cb826d32721552da12e741f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d60000cb1195a464080b0efb4949daf7594e0020"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50532.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50532"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"f92363d12359498f9a9960511de1a550f0ec41c2"},{"fixed":"d60000cb1195a464080b0efb4949daf7594e0020"},{"fixed":"ce1a69cc85006b494353911b35171da195d79e25"},{"fixed":"6a92129c8f999ff5b122c100ce7f625eb3e98c4b"},{"fixed":"6f6768e2fc8638fabdd8802c2ef693d7aef01db1"},{"fixed":"d17bca3ddfe507874cb826d32721552da12e741f"},{"fixed":"78316e9dfc24906dd474630928ed1d3c562b568e"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50532.json"}}],"schema_version":"1.7.5"}