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
F107574367: D31594.diff
Thu, Jan 16, 2:45 AM
Unknown Object (File)
Wed, Dec 25, 9:31 PM
Unknown Object (File)
Mon, Dec 23, 9:14 AM
Unknown Object (File)
Dec 15 2024, 1:54 PM
Unknown Object (File)
Dec 13 2024, 11:22 PM
Unknown Object (File)
Dec 12 2024, 7:38 PM
Unknown Object (File)
Dec 5 2024, 8:03 AM
Unknown Object (File)
Dec 2 2024, 6:54 PM
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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41188
Build 38077: arc lint + arc unit

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
945

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
945

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