Commit 683497566d48f86e04d026de1ee658dd74fc1077

Authored by Nicholas Bellinger
1 parent 83ff42fcce

iscsi-target: Explicily clear login response PDU in exception path

This patch adds a explicit memset to the login response PDU
exception path in iscsit_tx_login_rsp().

This addresses a regression bug introduced in commit baa4d64b
where the initiator would end up not receiving the login
response and associated status class + detail, before closing
the login connection.

Reported-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
Tested-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

drivers/target/iscsi/iscsi_target_util.c
... ... @@ -1295,6 +1295,8 @@
1295 1295 login->login_failed = 1;
1296 1296 iscsit_collect_login_stats(conn, status_class, status_detail);
1297 1297  
  1298 + memset(&login->rsp[0], 0, ISCSI_HDR_LEN);
  1299 +
1298 1300 hdr = (struct iscsi_login_rsp *)&login->rsp[0];
1299 1301 hdr->opcode = ISCSI_OP_LOGIN_RSP;
1300 1302 hdr->status_class = status_class;