Re: [PATCH] scsi: target: Fix NULL pointer dereference in core_alua_do_port_transition()

From: Martin K. Petersen (Oracle)

Date: Sun Nov 08 2026 - 23:01:43 EST


On Mon, 26 Oct 2026 19:51:33 +0800, shao.mingyin@xxxxxxxxxx wrote:

> core_alua_do_port_transition() assumes that the device has an ALUA LU
> group member and that the member is associated with an LU group. Neither
> is guaranteed: internal-use HBAs never allocate dev_alua_lu_gp_mem, and
> the association with an LU group is dropped when "NULL" is written to the
> device's alua_lu_gp attribute.
>
> The configfs path can reach the second case. After clearing the LU group
> association, writing the implicit ALUA access state of a target port
> group calls core_alua_do_port_transition(), which dereferences the NULL
> lu_gp in atomic_inc(&lu_gp->lu_gp_ref_cnt).
>
> [...]

Applied to 7.4/scsi-fixes, thanks!

[1/1] scsi: target: Fix NULL pointer dereference in core_alua_do_port_transition()
https://git.kernel.org/mkp/scsi/c/c0bb6614132c

--
Martin K. Petersen