From patchwork Thu Feb 2 00:58:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9550887 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3350860236 for ; Thu, 2 Feb 2017 00:59:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C4B12844A for ; Thu, 2 Feb 2017 00:59:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10F0D2845F; Thu, 2 Feb 2017 00:59:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 944FB2844A for ; Thu, 2 Feb 2017 00:59:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751410AbdBBA7K (ORCPT ); Wed, 1 Feb 2017 19:59:10 -0500 Received: from mail-by2nam03on0045.outbound.protection.outlook.com ([104.47.42.45]:46240 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751342AbdBBA7E (ORCPT ); Wed, 1 Feb 2017 19:59:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=P2G56+NKtasR1QXCgz8QGVUENil0WnPcJNNomqabslw=; b=E2cS8s7AxJPxcenIPTFc9975SdPOe7wlNgVcIkm7a0nvfQaB/r9YHkR3yT6Onz+AvORrcKS0xWdMuOdAnWvkD0WL4Txvch1hjfoclWqMx8VM56HqkdVw8XMnzveIj2g9aFNCYTi7zJFwvNyQKEaybTr7K8ZFdX1Mwiq+qr6uaro= Received: from BY2PR02CA0122.namprd02.prod.outlook.com (10.163.44.176) by SN1PR02MB1293.namprd02.prod.outlook.com (10.162.0.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Thu, 2 Feb 2017 00:59:02 +0000 Received: from BY2FFO11OLC013.protection.gbl (2a01:111:f400:7c0c::141) by BY2PR02CA0122.outlook.office365.com (2a01:111:e400:5261::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12 via Frontend Transport; Thu, 2 Feb 2017 00:59:01 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; infinidat.com; dkim=none (message not signed) header.d=none;infinidat.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BY2FFO11OLC013.mail.protection.outlook.com (10.1.15.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.2 via Frontend Transport; Thu, 2 Feb 2017 00:59:01 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 8A.7C.65426.17182985; Wed, 1 Feb 2017 16:46:41 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Wed, 1 Feb 2017 16:58:56 -0800 X-AuditID: 0ac94369-b62949800001ff92-31-589281712b8c Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 0C.63.16817.05482985; Wed, 1 Feb 2017 16:58:56 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Moshe David Subject: [PATCH v2 05/36] target/iscsi: Fix iSCSI task reassignment handling Date: Wed, 1 Feb 2017 16:58:22 -0800 Message-ID: <20170202005853.23456-6-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202005853.23456-1-bart.vanassche@sandisk.com> References: <20170202005853.23456-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMLMWRmVeSWpSXmKPExsXCddJ5kW5h46QIg+YtmhZ3r65it2hd+pbJ gcnj5bNtTB6fN8kFMEVx2aSk5mSWpRbp2yVwZfTt3sVacEGw4vqsA8wNjDf5uhg5OSQETCTm fd7K2MXIxSEksJRJ4si8w+wQzlZGiT+PVjLBVF1t/c0CkdjMKHHr+Ed2kASbgJHEt/czWUBs EQEDid+9FxhBbGYBN4neD1eZQWxhAR+JVcv3sILYLAIqEo8OzGQDsXkF7CV+tG5khFggL7Gr 7SJYDaeAg8Ti4xAzhYBqvv05CrZYQuAxi8SmH+sYIZoFJU7OfMICsUxC4uCLF8wQDeoSJ5fM Z5rAKDQLSdksJGULGJlWMYrlZuYU56anFhia6hUn5qVkFmfrJefnbmKEBG3mDsa7T7wPMQpw MCrx8AqITIoQYk0sK67MPcQowcGsJMLrCwx5Id6UxMqq1KL8+KLSnNTiQ4zSHCxK4ryvXvVH CAmkJ5akZqemFqQWwWSZODilGhhrtBZ6C25oLU34azDz9w32D7t7Gf4ujYx3j4n1VnvifFS/ ZfaEsFnnuObuOl2zI0Muii2a6/S2uzrNdnGWLO/3nHxszPcvWnxj5cfwBSJr9Odoymdk7E82 j2YwTkvvsW2qrnl92zH3TbjovG2q1iLRU38YTr/B7f7ifuXeAwHe/cfl533WLFZiKc5INNRi LipOBADCaJyQVgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEJMWRmVeSWpSXmKPExsXCtZEjRTegZVKEwZm7RhYHf7YxWty9uord onXpWyYHZo+Xz7YxeUxbc57J4/MmuQDmKC6blNSczLLUIn27BK6Mvt27WAsuCFZcn3WAuYHx Jl8XIyeHhICJxNXW3yxdjFwcQgIbGSWObrnLDpJgEzCS+PZ+JguILSJgIPG79wIjiM0s4Cbx 88tlMFtYwEdi1fI9rCA2i4CqRNvCLWBxXgF7iUW3D7FDLJCX2NV2EayGU8BBYvFxiJlCQDXf /hxlmcDIvYCRYRWjWG5mTnFuemaBoaFecWJeSmZxtl5yfu4mRrCvOSN3MD6daH6IkYmDU6qB cULP8fv691Zn71JhXXi54eaMm1ksr4uFsi3XFMd8ylo2k8FL+c9jgad7jp+N6L8gbrzh6qLC aT/fTrt4Qu1A9UdWycdfeK1VUwxDvP3yjfeseN6zdfWpHf0bdq+O+e35YspRxcXHU/wnVUpX x033ul1YF5PgaJMgL+nDYCZ9h79U5sqW9dXWe5VYijMSDbWYi4oTAXG9MA2lAQAA MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39850400002)(39410400002)(39860400002)(39450400003)(39840400002)(2980300002)(438002)(199003)(189002)(76176999)(305945005)(356003)(50466002)(48376002)(8936002)(6862003)(50986999)(97736004)(110136003)(6200100001)(106466001)(8676002)(81166006)(81156014)(50226002)(1691005)(68736007)(47776003)(2270400002)(36756003)(1076002)(7049001)(189998001)(33646002)(77096006)(53936002)(86362001)(2906002)(38730400001)(2950100002)(92566002)(5660300001)(6666003)(626004)(69596002)(5003940100001)(4326007)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB1293; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC013; 1:W9aCbJwNoUPeB2/PSV994OHYofNQeaQSbaKV72T7c4c2rBHijYImjhb2g0q/4ucfab4kE/ZNWJbun1U4Flx9i0ce10bBVGWZJ9mhcO9hQhNpB8KRQYJk0+sTkq4FA9IH8Yl51J9Ig3n0lH8slGcxGP0AusEg4a/LlWc88Qm/RqvbKPxoC2OEAdhMckLFDaeX0SK9z4pQKn9mpFf8QQa2NqimEvcqnilvogbt3IeGh5CZR6pgglXqTR21HTnjEVwzqsOB+Wr7SKnSsGgQdIGeu9zeLOWekDTHHa+PwH7vd4UbcqnEe8egFvUMhGNHgAyA4oO25GtknSDYK1/h7HfO1kDYd96rMbvFDJwN/cHAj/O3q5N+eq++omFwCnQxYtLyyXbDbFgDxhx+rT3EBzIIwbfDh36LhX8WBoVNPJiatV+hmBTf+C/UCWAEsrKCeNJA77WLrhLRNrOOq7vn3MS4exTWoeUQWNiMIFoStpg589f4sFdRJBALZ9Y5F7803UhW X-MS-Office365-Filtering-Correlation-Id: 170e7311-39e4-4d85-38d2-08d44b06ad87 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:SN1PR02MB1293; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1293; 3:jAKX8Cu/0wLKQR0nveYapVAq7JIwp+KfrR3LY5NiTfQwV/ab9P+TWdf754jEGiwAN31hxdfwdmWed4OXry2j1svgvGs9l7Qgw2G5wFusJc7r49kXJHug7jIHVjHHpKmoPXn5UlsNYZ/xVzW23YAbJ8WRjgDp4EdiwiNzsOSnsmjc3HAlYAu08rUT07myDrUtq3fOJzdl7RI+lxPutXtMo9S+j6X1Hd78yAktNY2q8HzuCINkbElagUq0iK0tGgc153/OjF3DaMy+DFTIrFERFLJw/mnOInZxS+pIXhVPGIJOZtDzVDbo4txyNShRKBMkhQAy66NtSvfkjHPdSul5cJmpyW8bMbkHt74cnfSLeZpqXnu4UahnGDsCGSwGFzuemNoRn9LPcCZDbjz8cnv54g== X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1293; 25:m8LBJjQmjuZjoKWRxBjY27YZFTEUhgmClBtajK390twMB5WWgYHW/kNXc/fu/ahjN7tB6QZtAMFI4+R0n2kixaUbDSfi6MnCZK9QQmlttYMz89m8vnwnuHTpb1bNlfIqgjzCwDCkNncJLV2zNpzRkodOus1I00+pxVkzujuL97zfuDl/+aRY/uA7SuRlxQcYs+MPYtGRrGRSASQ/e/XTMy+Pc69UsFX5jEfobLj7xdivVTT7H2bZWBES+UUvNKDieakqwbunslW4ni1BnrVvDUVkN8MQWBqZ1/cfwjCfvC2hd3c2BuTgtNkBOPkWOFclYtWA/YvxPDwPWiNWBbup50Rcj95PyTIRbmYPPrlc2OtaXB2f5IV5wsSvZ0t3TP+6G45jEakELTerZj7MgqZ8YYkWW93Ry3rgFwAMxpdt9ezcHa3MZJ3HAXOf0TPvMZbEu2TPtkzY5aChpY9VBJghCIQof8UYTKkdQnKuWcgYzY66bMZkVJo6LVf6pa+4zl94qv3GicXk7TvYqAi+XaixAocJnFoIKMETStLQMb8mA/Zp3PkYd9FnlVGUL9NiNhMRBiZyZRnYFwcJUmYJ23zwF+BafmjnKZ5ZjKSFmCRMlqmK9yXlvAmy/dR5QuYh4qTwafVCH7DFllllUStHSp1uMBB785ir7CKCVVgmiW9uxREl5ntFKlqPisonVw9vkvaUJKSkXRehe3TMqmtOyzRDYl0yQnnygrC+c1WTyMH4nklh/Yil/fikXztDYAqauyIw X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1293; 31:MwD1Ohe43DqgUKMcQhQfiS9frR9UvDGC1e1jM/S27xbh4C2lGDbrhGVPM4Br3+zbh+SR0e3CggFoivUlNtEUZzSO2mI0mtDqceM7V5h8NZLxQY8SrWyN+xA5vY4QMEPnSOSYes02jbzsVDikXx+jtt65/JBSZXIN6EKkWVWqzJgv7B4kYVzZ7w1l8XGAwsBLtiyY6mgvJRwKLxNbAFedQzdAEzNbcNuhM5+oljRX9vAFuGxBE33nAzbV518W5aTF8X9d5y6BZzifMi2b654ETg==; 20:UnLIKL6pLnqxy25hIMVgRiXIbWA69xHZn2fjSzwAdy0SihE3NixmVQ4jmaWUqzEFXKDHnc6MYAHVBQxixXiNC5WEUrrn8v/evjjZu0N6fDMccBI8S0tBSsPFdUT4I/uslxHHF2L7ZfOPYjRoNE2kDwelxvGxU1YJf6i/fOOoYOlsPRoFJv5XnQyE24id2WKLMCisOOi34aFgq7Y1eyb8+jvhl3eIe05WSg9Nbcn5N0weJYZVoNPqhmnfaq8+enoCS0Fsu6l0hH/6/81fdUrHh3UqwSt1AQW8CFMzf9Wh3ewf4LLlJSBWPftqcD8ly77M4q4wMdnxIru+W38eNna+KCR+hfRfdvqc5N1lX6IkVgXRCPl3aP+JKr4oJ20Q6t7fE4qbxIQDQ4nUxSqIPsdi/19F7FEBApu12Gmo3ldF88Q6rraCSn9WNsh/Y9KBd1eLR1D6D2UpwNbfAccCGg68GC2NKqLhSdHDOXYKZXS767DN24Uz7ESHpscw5mm1oEXO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(13018025)(13016025)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123558025)(20161123562025)(20161123564025)(6072148); SRVR:SN1PR02MB1293; BCL:0; PCL:0; RULEID:; SRVR:SN1PR02MB1293; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1293; 4:hePQo7MKF3X0KGT7FNQaoiOYm+YxZSb9UTQp+fEljr6fKMqNK7NXcU2EDWqoq1e7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GwNZ7r33wgvN85g9qxSExV4M?= =?us-ascii?Q?RJKeyuM4NNLAeHlLxlM8i45EHo9H2dHy2Yiql5WcGmjSN76k4F+jAj9ug=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1293; 6:ACrHyQvFXM1yuJI3oNM2RQvyjZ0XkEhlYxEirI8r4yard581+PTghxNfLWYxVJ3SuEhb8V8Ez5ZfCOlCArN/j71m7HpvZNeERQuHBSapQOilJ8gDJMEuyoLTAhqqTd8f7n+ouNsls3M9sTe2/di3Co86J/22Hgqk7evCXS5lQPb+GIz/cnduLxO0eqAjr075vPu8mzQ1IRXvmfUIPfBGc58jRssLAkinXSGVmaugOWhpZZKAKlSbWIwae88kqTTDn3SWTi7TK2Miu9CtT90lwwgh4PXYfuuc8e0gDbQJRJkbMZ7ZhuOpqzfoD4ZXpGRyJMEZZq1G0Gs2cI1PeT6W6G/j9XyK2WKNo+mgIQ+H4VbaxPwG5REXsP91VE8Rv5DCiSqXyu7wgAQy3TE7zA5x9+qBVFWm/92jc7BAM0oxXvoXsI33Prck4Y7Up8jeO0AF; 5:eem156okg4gZNL9KbBc8sLf2lQLo8anxKuoWS4WeVh8IAOXciwlbIBRwrTR471DBs+WwbM1VHAk8pFBogan/X/FwpSZ5/6VGRzE9XbNoWW0yygUMX8oarf4pqqvGH51Njj3nzY9HEYPjoE3rlqYNCnwHtX4KSe9W2Tl5I3U6tdo=; 24:m5twrEUbcL1GITiWiPNlrMT8uf/ntdD8MNPlbnbwoVPzglRHPFFezwglGpytHvUP/Uer3dLHQoGWtJznF9eug9ZpTpeZ98eDsfOxAoUF0/0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1293; 7:HBgoIMPjJFLgflzQabsPTv6WOZWE/iS+Pq5N2teHA4Jhy3/0292omlDbDuehKI0pk9feRbOHkbOoDq5xROs+Gqjw4kzeo/2pCL7RycVbe1PWd/SuKmZYDYJJPqNLIU8Nb+NryUHtjZvnD+QOo/kvDHwgGDtflk//PGdT/Kr0TDriz+TDK0pNCE2jqy0iKWQ2jW2A9ugL+mMf+V3+oG6rejLhBf2GTDPT8z6MlTEBS5+LEEmKrweK/fR36r1tOuOKBt/FRcpQaB0mxYTTY+kx0GuESI/3DG4RrHjKQsS9NQOmAThJaUelhdv4LrOsUKdCdsklBr12DtIjAe5V8nLL7jVuBPMVRZ/PddzTFWSh2UfmQOXdFkKdXIjsstUcswP/UTz6M3AvnYSX/n8xJ5FSrbFoAlqYn+3jj1eYF7XoS/+W4BFGPY09plJAn47IERMezFsMyQXUywv4jZRoZryKw1nhDCfvRM5BcLIj9lABGuPu1vlnpoTAKOaMXSM65WMunnx/+Vk5ZB6deNV55oC97a1bWU2G9ZiwS8oAZv93I+0TVtwaTONpSTHsJLmHCpPK X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2017 00:59:01.9133 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB1293 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allocate a task management request structure for all task management requests, including task reassignment. This change avoids that the se_tmr->response assignment dereferences an uninitialized se_tmr pointer. Reported-by: Moshe David Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Cc: Moshe David --- drivers/target/iscsi/iscsi_target.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index d16729fa1f67..b4f1d1cbe521 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1951,7 +1951,7 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, struct iscsi_tm *hdr; int out_of_order_cmdsn = 0, ret; bool sess_ref = false; - u8 function; + u8 function, tcm_function = TMR_UNKNOWN; hdr = (struct iscsi_tm *) buf; hdr->flags &= ~ISCSI_FLAG_CMD_FINAL; @@ -1997,10 +1997,6 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, * LIO-Target $FABRIC_MOD */ if (function != ISCSI_TM_FUNC_TASK_REASSIGN) { - - u8 tcm_function; - int ret; - transport_init_se_cmd(&cmd->se_cmd, &iscsi_ops, conn->sess->se_sess, 0, DMA_NONE, TCM_SIMPLE_TAG, cmd->sense_buffer + 2); @@ -2014,15 +2010,14 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, return iscsit_add_reject_cmd(cmd, ISCSI_REASON_BOOKMARK_NO_RESOURCES, buf); } - - ret = core_tmr_alloc_req(&cmd->se_cmd, cmd->tmr_req, - tcm_function, GFP_KERNEL); - if (ret < 0) - return iscsit_add_reject_cmd(cmd, + } + ret = core_tmr_alloc_req(&cmd->se_cmd, cmd->tmr_req, tcm_function, + GFP_KERNEL); + if (ret < 0) + return iscsit_add_reject_cmd(cmd, ISCSI_REASON_BOOKMARK_NO_RESOURCES, buf); - cmd->tmr_req->se_tmr_req = cmd->se_cmd.se_tmr_req; - } + cmd->tmr_req->se_tmr_req = cmd->se_cmd.se_tmr_req; cmd->iscsi_opcode = ISCSI_OP_SCSI_TMFUNC; cmd->i_state = ISTATE_SEND_TASKMGTRSP;