From patchwork Wed Jan 25 23:36:18 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: 9538111 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 DEE5C604A7 for ; Wed, 25 Jan 2017 23:37:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D516727F17 for ; Wed, 25 Jan 2017 23:37:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9F2A27FBB; Wed, 25 Jan 2017 23:37:06 +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 C7AC727F17 for ; Wed, 25 Jan 2017 23:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752067AbdAYXhE (ORCPT ); Wed, 25 Jan 2017 18:37:04 -0500 Received: from mail-bn3nam01on0065.outbound.protection.outlook.com ([104.47.33.65]:26907 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751064AbdAYXg5 (ORCPT ); Wed, 25 Jan 2017 18:36:57 -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=flhYcedoEwrwYbskRYGbuat9C7PZ9mQ4V109/IuACtY=; b=bcJUG65bdHyNp1e3zN36q5bdULKtiUvnLuH/8tlOiGCsjk4A/HYFyOfj+I1RVQLoo6Bj4NdcLU+fpBPCSKYuT7FmudO1mRvHycMljo23703zozqmH7/mSjAoWgTWyqtuD6Hnq+u4/R65+6YVlx4vRonN6nNK2PtKwR7UEtRVHTU= Received: from BY2PR02CA0104.namprd02.prod.outlook.com (10.163.44.158) by BY2PR02MB043.namprd02.prod.outlook.com (10.242.44.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Wed, 25 Jan 2017 23:36:54 +0000 Received: from BL2FFO11OLC013.protection.gbl (2a01:111:f400:7c09::103) by BY2PR02CA0104.outlook.office365.com (2a01:111:e400:5261::30) 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; Wed, 25 Jan 2017 23:36:55 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) 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.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BL2FFO11OLC013.mail.protection.outlook.com (10.173.160.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8 via Frontend Transport; Wed, 25 Jan 2017 23:36:53 +0000 Received: from MILHUBIP04.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 99.A1.01420.95439885; Wed, 25 Jan 2017 15:27:25 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Wed, 25 Jan 2017 15:36:50 -0800 X-AuditID: 0ac94371-46bff7000001058c-82-58893459f294 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 68.35.16817.19639885; Wed, 25 Jan 2017 15:36:49 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Moshe David Subject: [PATCH 06/34] target/iscsi: Fix iSCSI task reassignment handling Date: Wed, 25 Jan 2017 15:36:18 -0800 Message-ID: <20170125233646.2243-7-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170125233646.2243-1-bart.vanassche@sandisk.com> References: <20170125233646.2243-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrILMWRmVeSWpSXmKPExsXCddJ5kW6sSWeEwa5/HBZ3r65it2hd+pbJ gcnj5bNtTB6fN8kFMEVx2aSk5mSWpRbp2yVwZdzZ8J6p4KtAxdN9F9gbGDv4uhg5OSQETCRO LrzO3MXIxSEksJRJYv7hfiYIZxujxI1dc5hhqpZvmMACkdjIKHF38QmwBJuAkcS39zNZQGwR AQOJ370XGEFsZgE3id4PV4Fq2DmEBTwlvtiDRFkEVCVu3ZgO1skrYCex4+U5Fojx8hK72i6y gticAvYSrWd/gsWFgGrWH2gFu0dC4DGLxL1rZxkhmgUlTs58wgKxSkLi4IsXzBAN6hInl8xn msAoNAtJ2SwkZQsYmVYxiuVm5hTnpqcWGJroFSfmpWQWZ+sl5+duYoQEbOEOxte3vQ8xCnAw KvHwCmzpiBBiTSwrrsw9xCjBwawkwrtOrjNCiDclsbIqtSg/vqg0J7X4EKM0B4uSOO/F6I9h QgLpiSWp2ampBalFMFkmDk6pBkaLSs76R2KRb8rWs+wxZlzF9lx30r+4/oSnp+Lau1alMwml fLmc/nvHvovR06/bcr5vvfOtJEoo0if52aforoziixy6LafWl91N3va0OWX3VYaSazxL3f1O fgu+4pZnuVFh2cLn771++NmxXLB+f3lLyY7KE/XHFOJOlTE56p/3evbl+56oDdxKLMUZiYZa zEXFiQAXl5FnVAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAJMWRmVeSWpSXmKPExsXCtZGTTXeiWWeEwfMLKhYHf7YxWty9uord onXpWyYHZo+Xz7YxeUxbc57J4/MmuQDmKC6blNSczLLUIn27BK6MOxveMxV8Fah4uu8CewNj B18XIyeHhICJxPINE1i6GLk4hATWM0q8bprPDJJgEzCS+PZ+JguILSJgIPG79wIjiM0s4Cbx 88tlIJudQ1jAU+KLPUiURUBV4taN6WCdvAJ2EttWfWSEGC8vsavtIiuIzSlgL9F69ifYRCGg mvUHWpkmMHIvYGRYxSiWm5lTnJueWWBoqFecmJeSWZytl5yfu4kR4ufIHYxPJ5ofYmTi4JRq YBTYf+GHv2Ol1qame7ceBN8/cdPi5uz+d0ovgjwV/eaVvH9lVtTPYPm0Wpr52v3TAuffSVWa ThBvzbm/+r9rv99KCSadKUeqzp/fbc+qYZ7p1hr+4WA+i40Ii7UiT1+ewUQOI6t592wr+n+/ P9xw7gXf15LqZV9M2HRt5kRun7Zy836WTJ/JrkosxRmJhlrMRcWJAINb8iqjAQAA MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39410400002)(39850400002)(39860400002)(39840400002)(39450400003)(2980300002)(438002)(189002)(199003)(68736007)(189998001)(50466002)(2950100002)(2906002)(50986999)(6200100001)(6666003)(76176999)(2270400002)(86362001)(97736004)(53936002)(1076002)(47776003)(77096006)(7049001)(33646002)(626004)(69596002)(48376002)(4326007)(38730400001)(305945005)(50226002)(110136003)(8676002)(81166006)(106466001)(356003)(81156014)(6862003)(8936002)(5003940100001)(92566002)(1691005)(5660300001)(36756003)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB043; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC013; 1:60El/nlWr0SXmiPCVe5D0+tqDgu70OfNBX86+rHWr6neiX3m9RHsmarJUMphlF4VgDYCBjsLuz9Q3/+WGZHANeCmMBy0PkZKrPKqpCv/62n65RaURlFDi8Lh19XOtrxZaN0TTkvfJESXMshoac1PNzs+U44LtJG06o9HDxGkkhmTh6acULNj+JjPp44uFinHQ/dBbIXseDO+FDATJmKFhzIe2K73kaY8kb4QOaqp9ez8gZDUryZ5UkZNznlz7U2dPbtfpc9U7TS2crUoJm50eSDB5HW6nr/X5GeWRod+Xm8w3CroeNfg5WXNBhm5EX5bFlqZTLScLGvs+lTmEDWFmx4T+7a0wrkDOZ6FEfHXpno7iw/QJUDrWwQ1mdiWT5hxP22493MobX2tG2KrEFSzHPS6QpRA/huTb+qmgY7p77fqRBkgnAI3vvovaqG7gB+S9rDdUd1DlkQDhxeCoAWq77/ccI1vS6Tp1DGcAvGyKILCL8BcUx+LcRO4EoklC4EW X-MS-Office365-Filtering-Correlation-Id: 44e8fcce-a197-4a2f-9dea-08d4457b0b93 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:BY2PR02MB043; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB043; 3:qaeRqo2fr1QEpNYk/UKPpCcLLXGBFNkDkRtRf5u4bGwvjyRCPzJt/Veo1TMJPB+vGB9GH/dlHcfiNHBu5Mr71lSbHbrSbi6B/+qLqXOROCXQixCLwMDuz/tft9RC3EnYTXi3oqV0IGTorrQTU8tlsxucMwlSK0/WTW3KuCP+rQ/mEShaapOwpdAOMABcFRSm6mr7ICzvR/90zhccxgWApn6A2JncdtAMan3G5Msx2rRFen/XINQQ2nVoE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R0CWqt46w4qfppcg0HHacd5omjFb8vsARq38dgYx6DXMbAHawXtcNnJc2lAucEqNhnUmuHrEK4O5WRo4IlkRSAtv39vyT8Z9l6eIw2iXltqyguq/NG3nT84SHt9v+WXSqVpVfGfHMUC7SJAbG/NGq59/BvWuCGCtZID+fM7uhrBo9UEgSLCKtHR1ss296p19L9EruympBavbAcGvdYjh6nEVrHhHQJenTcthwI5ZyPYUkBtstevUUWUhDYzkmCGbSOg+0f1yoDUX6y6agg1s+zClnS/KHztnyx2eXtpWfxju5RxPNVGhTApNbuB9Myj9jdryu4N8Pk1i4Z22iLO5EP352npe4GEmM/cN25QUgVsVRy7jdIB24QsyaMrvYTn7Gj43+8/nkA9i5 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)(13016025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148); SRVR:BY2PR02MB043; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB043; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB043; 4:J6VftIcTS3yPbwMP4xjR30oGTOoXdj9vIdxhH59b1NobMrbBrOyM4jX+xDaBgTwc+73TPCOWTyUeV0zqLa3rHEgsFqOrzlJVOE3K/2WNSEiP/iRoTZHBxvLcgTBbnvmlqZb5c7p7Kb2WX8/q6cWCFn8+ywiH0/BdLwsDO7rK829kZFzrOaBpVLtIikS9SmHJxfd6vJZkENQeP4bd8tzfBVWsoJgIAUPWI3R+UgO61TJNzqzZ5VyKukaHth5PKQP02J7r58Oi5ZqMSZrVc5g13agUJeTeXixdI0tzxomc5MKtI/zx65eROvZBmc7ECeHepnYDvy+WxbKL7qNGuh0Ywm2HPcw3AfXbt1BLtMivazJDyST92LNcslmGjWJrC3scTUJU1kBeKmi1pqY4Hga667VgmEDHFj10pnUrIj8CObtfMaejegnIf0C5GMnsDnGkKWohLozh8YkDMfSR9XyVjvP7Zfslze//BCodpG8nRp7Gj87r5H7pKkO7HxXWsJUUNjLpdZEpNIvDpyqzhMoXPIO4boV+OQ+8WnZqTW4cHkGkyG+5wGr5j24J0ENq/kwod3a6ctpxluRn/ifIy3NO+PFWunk/aJpdR7sLwVuQCkQKvoUgOKel6N/UEfAMy5UKKqq/ixWtGAIUpCsCtFFRq7sypR8uXFzI3FGGPOzhmFQ= X-Forefront-PRVS: 01986AE76B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR02MB043; 23:UqHSLVyeRTI3hHoOXBdP01IR7qSXjs3vp6x6naDc1h?= =?us-ascii?Q?tagJ1EsnbYRQPwJKouPDQF+Y+yYy6wfuMYcj5MfN4xPcWU2/f2DiKiin9i96?= =?us-ascii?Q?Az0oFGV60zXYBFNYl5IYH0OcMJqV0Gu+2k24DP7d7vdIujaCiN917hq3WWuT?= =?us-ascii?Q?XTmwB6UbjaTq79NkebLr2HdHGhEBiXFNuySRc96VkBdFSpL2Z18xtlXfq6hr?= =?us-ascii?Q?U+664yE1sRFdOr+KcNSiLQkmgImvmG9TQfNbqkTjmv94k7p8XrjFhNHDWWpj?= =?us-ascii?Q?uk5rDolG/i9gZRdYIBQMiFn1AdSyex3bG78O9apVOmNyItPQG21SrxAxPK09?= =?us-ascii?Q?KB1rNxgrS1YaDlZeX4wPFPQSDDxqzkEjzKteUzNPUZokDKIE4MadPy6TkD8e?= =?us-ascii?Q?YLDd4+R0gQCrJm6MQ6U822BLNGrysGnFKvTzgf1RBay0AQyBdR5/kBRrFwbv?= =?us-ascii?Q?dOw3B8CX50NipvUT+ZGDU1s0tGswB1Qczq/dVivTvv/g6IOJ6dtbVK1RWPW/?= =?us-ascii?Q?yhRzHBl+H1Gq5joGw2PUvGzB7OCq0EPrZ+LPfb0m9QBXCOIcRfF+CI54fDOQ?= =?us-ascii?Q?Er29Jf+RLpywUhvL/xlMYR8aMam76JLnU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lpDYNTz3lbjSuZs7XMdvd68MNy95SYXFr+OrL2pRnjJCBM2ey2mkNSONY0Qaw76lgJkEpUrd+suegdP45nlkQJrq3TPZoc6gun5osPa7gnIe1wN1DQxxUjogjDALHYh7Hx1tBd8g0eDRK0+BKaEuCzc14Gcx1I7qNd46MmtzwuQZH0ajf82jga7xUUKbr3MISWP11MZdJLPmqJ62L8BXTJU/x/w==; 5:tLNFTZkfUkcl7ynpXz6+ejmopGIATeqcTruAdlkhbq9vswyJGQjolN9+6B35kBQI9kEyFkC2/SCMw+98GJSMxJdkco+GSZ++RFi05e/BYiYAa7h5Oms5i/T5gzsC0gFRkhVKzOQTbYoDQSvr1rbExw==; 24:h84hmNJuSgFuljAA4bb3e0KIg1LAiWlz3uW+BvpcUjZQhJAaB8Pn7spOgg8T1FRZptki5iFfBjEyfCYArlPSon9RVN6iNvpHGECe9ndjwg8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB043; 7:mfgSDxS1sQcnrsXjNe9jJoQBNghwd1yquMycGzLXOYdhqkLveO1RZytYQSRYVUD+tdT4Bmz2xjbT3AxChTCQ50VEUhaRg+fGAn+d7cP/pXDFVVdjdC8VWvM8i7y+ElDXEPNXm73Bi12tmpwm5/ZlASsKy9WbuRC0+/0GG+ZeDRIbYd7KyEg2KeAteoR0OwVIy+GBS79/vVevsSeYX1DQ6/nz4TmEt4aaBV2FQ7VOyQAJle7DE2qjbux1hRhKbOLenPkmgoOh9vxLMNsdTM+rYKvZZUH3DY7eDKLw+ANL2QzfC4vSZPxhqj2Dr4Ua1lrb5H1pQHhOldJ9lrTU+RxHWlizjRva05kwOfRyz+lDXsMNzs8aufOsiV3xacbwdWoqxrExrmCF5RypAjfQFT0Al7p50dVjtt5WRlFbv98X65453FBSKcudohWZ3hBaxk0CiAElJA3x61NfK18X1F0Ibg== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2017 23:36:53.9388 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB043 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 Cc: Moshe David Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- 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 3696cfbf1cf5..d0664b8423e8 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1955,7 +1955,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 = UNKNOWN_TMF; hdr = (struct iscsi_tm *) buf; hdr->flags &= ~ISCSI_FLAG_CMD_FINAL; @@ -2001,10 +2001,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); @@ -2018,15 +2014,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;