[PATCH 1/2] nvme-tcp: validate R2T PDU in nvme_tcp_handle_r2t()

Sagi Grimberg sagi at grimberg.me
Mon Nov 22 02:45:14 PST 2021


> @@ -2321,6 +2327,9 @@ static blk_status_t nvme_tcp_setup_cmd_pdu(struct nvme_ns *ns,
>   	req->data_sent = 0;
>   	req->pdu_len = 0;
>   	req->pdu_sent = 0;
> +	req->h2cdata_left = 0;
> +	req->h2cdata_offset = 0;
> +	req->h2cdata_ttag = 0;

This doesn't hurt anything, but it also redundant AFAICT no? these are
only referenced in nvme_tcp_setup_h2c_data_pdu which is called from
nvme_tcp_handle_r2t, which is setting these right before the call...



More information about the Linux-nvme mailing list