scsi: mpi3mr: Fix NULL pointer dereference in mpi3mr_sas_port_add()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e22bae30667a7e74ed057e00fb6e8c79e0738de3 · < dba9e2181ca5e875f98b8b9b4535cdaab87dcb0d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: mpi3mr: Fix NULL pointer dereference in mpi3mr_sas_port_add()
sas_port_alloc_num() can return NULL on memory allocation failure. The return value is passed directly to sas_port_add() without a NULL check, which causes a NULL pointer dereference.
Additionally, if sas_port_add() fails, the allocated port is not freed before jumping to out_fail, leaking the sas_port structure. Call sas_port_free() to properly release it.
From the CVE record · Linux
The Linux kernel's mpi3mr driver passes a NULL result from sas_port_alloc_num() to sas_port_add() if memory allocation fails, causing a NULL pointer dereference. A failed sas_port_add() also leaks the allocated port. The input does not specify an attacker path, authentication requirements, or user interaction.
Engineers running Linux kernels with the mpi3mr driver should check their kernel versions; affected versions are not specified.