Re: [PATCH] scsi: libiscsi_tcp: check the data direction of a Data-In PDU

From: Martin K. Petersen (Oracle)

Date: Wed Sep 16 2026 - 22:30:22 EST


On Sat, 01 Aug 2026 22:36:35 +0900, Yehyeong Lee wrote:

> The Data-In branch of iscsi_tcp_hdr_dissect() resolves the ITT to a task
> and copies the PDU's data segment into that command's scatterlist without
> asking whether the command was reading. iscsi_tcp_r2t_rsp() in the same
> file does ask, and rejects an R2T for a command that is not DMA_TO_DEVICE.
>
> A target that answers a WRITE command's ITT with a Data-In therefore has
> the initiator write target-supplied bytes into the pages that write was
> about to send. Those are the caller's own pinned pages for an O_DIRECT
> write, and page cache pages for a buffered one.
>
> [...]

Applied to 7.3/scsi-fixes, thanks!

[1/1] scsi: libiscsi_tcp: check the data direction of a Data-In PDU
https://git.kernel.org/mkp/scsi/c/bce07e2f37b5

--
Martin K. Petersen