Patch "iscsi-target: Add login_keys_workaround attribute for non RFC initiators" has been added to the 4.12-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
iscsi-target: Add login_keys_workaround attribute for non RFC initiators
to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
iscsi-target-add-login_keys_workaround-attribute-for-non-rfc-initiators.patch
and it can be found in the queue-4.12 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
138d351eefb727ab9e41a3dc5f112ceb4f6e59f2Mon Sep 17 00:00:00 2001
From: Nicholas Bellinger <[email protected]>
Date: Fri, 7 Jul 2017 14:45:49 -0700
Subject: iscsi-target: Add login_keys_workaround attribute for non RFC initiators
From: Nicholas Bellinger <[email protected]>
commit 138d351eefb727ab9e41a3dc5f112ceb4f6e59f2 upstream.
This patch re-introduces part of a long standing login workaround that was recently dropped by:
commit 1c99de981f30b3e7868b8d20ce5479fa1c0fea46
Author: Nicholas Bellinger <[email protected]>
Date: Sun Apr 2 13:36:44 2017 -0700
iscsi-target: Drop work-around for legacy GlobalSAN initiator
Namely, the workaround for FirstBurstLength ended up being required by Mellanox Flexboot PXE boot ROMs as reported by Robert.
So this patch re-adds the work-around for FirstBurstLength within iscsi_check_proposer_for_optional_reply(), and makes the key optional to respond when the initiator does not propose, nor respond to it.
Also as requested by Arun, this patch introduces a new TPG attribute named 'login_keys_workaround' that controls the use of both the FirstBurstLength workaround, as well as the two other existing workarounds for gPXE iSCSI boot client.
By default, the workaround is enabled with login_keys_workaround=1, since Mellanox FlexBoot requires it, and Arun has verified the Qlogic MSFT initiator already proposes FirstBurstLength, so it's uneffected by this re-adding this part of the original work-around.
--- drivers/target/iscsi/iscsi_target_configfs.c | 2 + drivers/target/iscsi/iscsi_target_nego.c | 6 ++- drivers/target/iscsi/iscsi_target_parameters.c | 41 +++++++++++++++++-------- drivers/target/iscsi/iscsi_target_parameters.h | 2 - drivers/target/iscsi/iscsi_target_tpg.c | 19 +++++++++++ drivers/target/iscsi/iscsi_target_tpg.h | 1 include/target/iscsi/iscsi_target_core.h | 9 +++++ 7 files changed, 64 insertions(+), 16 deletions(-)
drivers/target/iscsi/iscsi_target_configfs.c +2 -0
@@ -781,6 +781,7 @@ DEF_TPG_ATTRIB(default_erl);DEF_TPG_ATTRIB (t10_pi);DEF_TPG_ATTRIB (fabric_prot_type);DEF_TPG_ATTRIB (tpg_enabled_sendtargets); +DEF_TPG_ATTRIB (login_keys_workaround);static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = { &iscsi_tpg_attrib_attr_authentication,
@@ -796,6 +797,7 @@ static struct configfs_attribute *lio_ta &iscsi_tpg_attrib_attr_t10_pi, &iscsi_tpg_attrib_attr_fabric_prot_type, &iscsi_tpg_attrib_attr_tpg_enabled_sendtargets, + &iscsi_tpg_attrib_attr_login_keys_workaround, NULL, };
drivers/target/iscsi/iscsi_target_nego.c +4 -2
@@ -886,7 +886,8 @@ static int iscsi_target_handle_csg_zero(SENDER_TARGET , login->rsp_buf, &login->rsp_length, - conn->param_list); + conn->param_list, + conn->tpg->tpg_attrib.login_keys_workaround);if (ret <0 )return -1 ;
@@ -956,7 +957,8 @@ static int iscsi_target_handle_csg_one(sSENDER_TARGET , login->rsp_buf, &login->rsp_length, - conn->param_list); + conn->param_list, + conn->tpg->tpg_attrib.login_keys_workaround);if (ret <0 ) {iscsit_tx_login_rsp (conn,ISCSI_STATUS_CLS_INITIATOR_ERR ,ISCSI_LOGIN_STATUS_INIT_ERR );
drivers/target/iscsi/iscsi_target_parameters.c +28 -13
68 lines not on this page · raw message
drivers/target/iscsi/iscsi_target_parameters.h +1 -1
@@ -46,7 +46,7 @@ extern int iscsi_extract_key_value(charextern int iscsi_update_param_value (struct iscsi_param *,char *);extern int iscsi_decode_text_input (u8 ,u8 ,char *,u32 ,struct iscsi_conn *);extern int iscsi_encode_text_output (u8 ,u8 ,char *,u32 *, -struct iscsi_param_list *); +struct iscsi_param_list *,bool );extern int iscsi_check_negotiated_keys (struct iscsi_param_list *);extern void iscsi_set_connection_parameters (struct iscsi_conn_ops *,struct iscsi_param_list *);
drivers/target/iscsi/iscsi_target_tpg.c +19 -0
@@ -227,6 +227,7 @@ static void iscsit_set_default_tpg_attri a->t10_pi =TA_DEFAULT_T10_PI ; a->fabric_prot_type =TA_DEFAULT_FABRIC_PROT_TYPE ; a->tpg_enabled_sendtargets =TA_DEFAULT_TPG_ENABLED_SENDTARGETS ; + a->login_keys_workaround =TA_DEFAULT_LOGIN_KEYS_WORKAROUND ; }int iscsit_tpg_add_portal_group (struct iscsi_tiqn *tiqn,struct iscsi_portal_group *tpg)
@@ -899,3 +900,21 @@ int iscsit_ta_tpg_enabled_sendtargets(return 0 ; } + +int iscsit_ta_login_keys_workaround ( +struct iscsi_portal_group *tpg, +u32 flag) +{ +struct iscsi_tpg_attrib *a = &tpg->tpg_attrib; + +if ((flag !=0 ) && (flag !=1 )) { +pr_err ("Illegal value %d\n" , flag); +return -EINVAL ; + } + + a->login_keys_workaround = flag; +pr_debug ("iSCSI_TPG[%hu] - TPG enabled bit for login keys workaround: %s " , + tpg->tpgt, (a->login_keys_workaround) ?"ON" :"OFF" ); + +return 0 ; +}
drivers/target/iscsi/iscsi_target_tpg.h +1 -0
@@ -48,5 +48,6 @@ extern int iscsit_ta_default_erl(structextern int iscsit_ta_t10_pi (struct iscsi_portal_group *,u32 );extern int iscsit_ta_fabric_prot_type (struct iscsi_portal_group *,u32 );extern int iscsit_ta_tpg_enabled_sendtargets (struct iscsi_portal_group *,u32 ); +extern int iscsit_ta_login_keys_workaround (struct iscsi_portal_group *,u32 );#endif /* ISCSI_TARGET_TPG_H */
include/target/iscsi/iscsi_target_core.h +9 -0
@@ -66,6 +66,14 @@ struct sock;#define TA_DEFAULT_FABRIC_PROT_TYPE 0/* TPG status needs to be enabled to return sendtargets discovery endpoint info */ #define TA_DEFAULT_TPG_ENABLED_SENDTARGETS 1 +/* +* Used to control the sending of keys with optional to respond state bit, +* as a workaround for non RFC compliant initiators,that do not propose, +* nor respond to specific keys required for login to complete. +* +* See iscsi_check_proposer_for_optional_reply() for more details. +*/ +#define TA_DEFAULT_LOGIN_KEYS_WORKAROUND 1#define ISCSI_IOV_DATA_BUFFER 5
@@ -769,6 +777,7 @@ struct iscsi_tpg_attrib {u8 t10_pi;u32 fabric_prot_type;u32 tpg_enabled_sendtargets; +u32 login_keys_workaround;struct iscsi_portal_group *tpg; };
Patches currently in stable-queue which might be from [email protected] are
queue-4.12/xen-scsiback-fix-a-tmr-related-use-after-free.patch queue-4.12/iscsi-target-add-login_keys_workaround-attribute-for-non-rfc-initiators.patch