scsi: target/iscsi: Make sure PDU processing continues if parsing a command fails
authorBart Van Assche <bvanassche@acm.org>
Tue, 2 Apr 2019 19:58:15 +0000 (12:58 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 13 Apr 2019 00:20:06 +0000 (20:20 -0400)
commit4b3766ec0e1840f45bc9238e7e749922bdcb7016
tree744c05b16d394c9b0c8cef665fe7411dbbcb4a3b
parent2e39f1c9064d54e51e939ce5f3cf34527ef5603f
scsi: target/iscsi: Make sure PDU processing continues if parsing a command fails

Currently the iSCSI target driver sends a CHECK CONDITION code back to the
initiator if the immediate data buffer is too large but it does not discard
that immediate data buffer. The result is that the iSCSI target driver
attempts to parse the immediate data itself as iSCSI PDUs and that all
further iSCSI communication fails. Fix this by receiving and discarding too
large immediate data buffers.

Cc: Mike Christie <mchristi@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/iscsi/iscsi_target.c