]> git.karo-electronics.de Git - karo-tx-linux.git/commit
iscsi-target: Reject zero-length payloads during SecurityNegotiation
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 28 May 2014 19:07:40 +0000 (12:07 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 28 May 2014 19:17:13 +0000 (12:17 -0700)
commit3936fed73039761a54d756010bcf39925224797b
treed331ad8c647709cdc8a254278c1346b6a3c9c37f
parente5e7231f078890d38126853b7b67ec611f700290
iscsi-target: Reject zero-length payloads during SecurityNegotiation

This patch changes iscsi_target_handle_csg_zero() to explicitly
reject login requests in SecurityNegotiation with a zero-length
payload, following the language in RFC-3720 Section 8.2:

  Whenever an iSCSI target gets a response whose keys, or their
  values, are not according to the step definition, it MUST answer
  with a Login reject with the "Initiator Error" or "Missing Parameter"
  status.

Previously when a zero-length login request in CSG=0 was received,
the target would send a login response with CSG=0 + T_BIT=0 asking
the initiator to complete authentication, and not fail the login
until MAX_LOGIN_PDUS was reached.  This change will now immediately
fail the login attempt with ISCSI_STATUS_CLS_INITIATOR_ERR status.

Reported-by: Tejas Vaykole <tejas.vaykole@calsoftinc.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_nego.c