Page MenuHomeFreeBSD

iscsi: Validate DataSN values in Data-In PDUs in the initiator.
ClosedPublic

Authored by jhb on Aug 17 2021, 9:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 9, 3:02 PM
Unknown Object (File)
Mar 22 2024, 2:13 AM
Unknown Object (File)
Mar 6 2024, 9:53 AM
Unknown Object (File)
Feb 26 2024, 3:52 AM
Unknown Object (File)
Jan 20 2024, 3:11 PM
Unknown Object (File)
Dec 25 2023, 4:55 PM
Unknown Object (File)
Dec 22 2023, 6:03 AM
Unknown Object (File)
Dec 22 2023, 6:03 AM
Subscribers

Details

Summary

As is done in the target, require that DataSN values are consecutive
and in-order. If an out of order Data-In PDU is received, force a
session reconnect. In addition, when a SCSI Response PDU is received,
verify that the ExpDataSN field matches the count of Data-In PDUs
received for this command. If not, fail the I/O request.

Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Aug 17 2021, 9:28 PM

Generally it looks good to me. I am just thinking whether in case of bhssr_expdatasn mismatch we should also kill the connection, since it should not happen.

In D31594#712266, @mav wrote:

Generally it looks good to me. I am just thinking whether in case of bhssr_expdatasn mismatch we should also kill the connection, since it should not happen.

Mmmm, quite possibly, I just wasn't sure how to do it here.

sys/dev/iscsi/iscsi.c
944

If I force a reconnect and skip the call to xpt_done() at the end of the function, will the ccb get resubmitted after the connection has reconnected?

sys/dev/iscsi/iscsi.c
944

As I see, iscsi_session_terminate_tasks() completes with CAM_REQUEUE_REQ only I/Os in is_outstanding queue. So for that to happen this check and connection termination should be done before iscsi_outstanding_remove() above.

jhb marked an inline comment as done.Aug 24 2021, 8:26 PM
  • Reconnect if expdatasn doesn't match.
  • Trim a no-longer-needed variable.
sys/dev/iscsi/iscsi.c
897

Wouldn't it be better to say "SCSI Response" as the PDU is called in RFC?

jhb marked an inline comment as done.Aug 24 2021, 9:09 PM
  • Update error message.
This revision is now accepted and ready to land.Aug 24 2021, 9:38 PM