Re: [PATCH] scsi: scsi_transport_fc: reject truncated FPIN payloads
From: Martin K. Petersen (Oracle)
Date: Tue Nov 17 2026 - 23:50:29 EST
On Sat, 31 Oct 2026 22:22:43 +0800, shao.mingyin@xxxxxxxxxx wrote:
> fc_host_fpin_rcv() computes the length of the TLV area as
>
> bytes_remain = fpin_len - offsetof(struct fc_els_fpin, fpin_desc);
>
> without checking that the payload is at least as large as the fixed
> FC-ELS header. For fpin_len smaller than the header size the subtraction
> underflows to a huge u32, and the min_t() on the next line also reads
> fpin->desc_len at offset 4, which is outside the payload when fpin_len is
> 4 or less. The TLV walker then parses memory that is not part of the FPIN.
>
> [...]
Applied to 7.5/scsi-queue, thanks!
[1/1] scsi: scsi_transport_fc: reject truncated FPIN payloads
https://git.kernel.org/mkp/scsi/c/db1fe578b7ea
--
Martin K. Petersen