# CVE-2022-50532: scsi: mpt3sas: Fix possible resource leaks in mpt3sas_transport_port_add()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.16%, higher than 5% of CVEs (2026-12-01)
- Published: 2025-10-07T15:19:22.581Z
- Modified: 2026-11-05T21:17:04.123Z
- Weaknesses: CWE-401
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

scsi: mpt3sas: Fix possible resource leaks in mpt3sas_transport_port_add()

In mpt3sas_transport_port_add(), if sas_rphy_add() returns error,
sas_rphy_free() needs be called to free the resource allocated in
sas_end_device_alloc(). 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 : device_del+0x54/0x3d0
lr : device_del+0x37c/0x3d0
Call trace:
 device_del+0x54/0x3d0
 attribute_container_class_device_del+0x28/0x38
 transport_remove_classdev+0x6c/0x80
 attribute_container_device_trigger+0x108/0x110
 transport_remove_device+0x28/0x38
 sas_rphy_remove+0x50/0x78 [scsi_transport_sas]
 sas_port_delete+0x30/0x148 [scsi_transport_sas]
 do_sas_phy_delete+0x78/0x80 [scsi_transport_sas]
 device_for_each_child+0x68/0xb0
 sas_remove_children+0x30/0x50 [scsi_transport_sas]
 sas_rphy_remove+0x38/0x78 [scsi_transport_sas]
 sas_port_delete+0x30/0x148 [scsi_transport_sas]
 do_sas_phy_delete+0x78/0x80 [scsi_transport_sas]
 device_for_each_child+0x68/0xb0
 sas_remove_children+0x30/0x50 [scsi_transport_sas]
 sas_remove_host+0x20/0x38 [scsi_transport_sas]
 scsih_remove+0xd8/0x420 [mpt3sas]

Because transport_add_device() is not called when sas_rphy_add() fails, the
device is not added. When sas_rphy_remove() is subsequently called to
remove the device in the remove() path, a NULL pointer dereference happens.

(As written by CVE List.)

## Affected

- Linux Linux: from f92363d12359498f9a9960511de1a550f0ec41c2 before d60000cb1195a464080b0efb4949daf7594e0020; from f92363d12359498f9a9960511de1a550f0ec41c2 before ce1a69cc85006b494353911b35171da195d79e25; from f92363d12359498f9a9960511de1a550f0ec41c2 before 6a92129c8f999ff5b122c100ce7f625eb3e98c4b; from f92363d12359498f9a9960511de1a550f0ec41c2 before 6f6768e2fc8638fabdd8802c2ef693d7aef01db1; from f92363d12359498f9a9960511de1a550f0ec41c2 before d17bca3ddfe507874cb826d32721552da12e741f; from f92363d12359498f9a9960511de1a550f0ec41c2 before 78316e9dfc24906dd474630928ed1d3c562b568e; 3.8 (not affected: before 3.8; from 5.4.229 up to 5.4.*; from 5.10.163 up to 5.10.*; from 5.15.86 up to 5.15.*; from 6.0.16 up to 6.0.*; from 6.1.2 up to 6.1.*; from 6.2 up to *)
- linux linux_kernel: from 3.8 before 5.4.229; from 5.5 before 5.10.163; from 5.11 before 5.15.86; from 5.16 before 6.0.16; from 6.1 before 6.1.2

## References

- <https://git.kernel.org/stable/c/d60000cb1195a464080b0efb4949daf7594e0020> (patch)
- <https://git.kernel.org/stable/c/ce1a69cc85006b494353911b35171da195d79e25> (patch)
- <https://git.kernel.org/stable/c/6a92129c8f999ff5b122c100ce7f625eb3e98c4b> (patch)
- <https://git.kernel.org/stable/c/6f6768e2fc8638fabdd8802c2ef693d7aef01db1> (patch)
- <https://git.kernel.org/stable/c/d17bca3ddfe507874cb826d32721552da12e741f> (patch)
- <https://git.kernel.org/stable/c/78316e9dfc24906dd474630928ed1d3c562b568e> (patch)

## Sources

- CVE List: [CVE-2022-50532](https://www.cve.org/CVERecord?id=CVE-2022-50532), CVE Terms of Use, modified 2026-11-05
- NVD: [CVE-2022-50532](https://nvd.nist.gov/vuln/detail/CVE-2022-50532), Public domain, modified 2026-11-05

---

Page: https://cve.day/CVE-2022-50532 · Whole record: https://cve.day/CVE-2022-50532.json · Rebuilt by cve.day 2026-11-25T22:58:21.260Z
