scsi: mpi3mr: Fix target device refcount leak in mpi3mr_sas_port_add()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e22bae30667a7e74ed057e00fb6e8c79e0738de3 · < 419d129f970aaa6567dbac366b0c93784bf9ec97| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: mpi3mr: Fix target device refcount leak in mpi3mr_sas_port_add()
mpi3mr_get_tgtdev_by_addr() increments the target device kref when it returns a device. If a subsequent error triggers a goto out_fail after the tgtdev reference is acquired, the reference is never released because the out_fail path does not call mpi3mr_tgtdev_put(). This prevents the target device structure from ever being freed.
Add a tgtdev put in the out_fail path, guarded by a NULL check since tgtdev is only acquired for SAS_END_DEVICE types and the same cleanup path is shared by earlier error cases where tgtdev is still NULL.
From the CVE record · Linux
The Linux kernel's mpi3mr driver fails to release a target-device reference when an error occurs after acquiring it in mpi3mr_sas_port_add(). The target-device structure then cannot be freed. The input does not establish an attacker-controlled trigger or specify network access, authentication, or user-interaction requirements.
Engineers running Linux kernels with the mpi3mr driver should check their vendor advisory for affected versions; none are listed in the input.