From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30B86C433E2 for ; Tue, 15 Sep 2020 07:36:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4BA4214F1 for ; Tue, 15 Sep 2020 07:36:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600155399; bh=SfCd9T6WzUF9mKGYa2eCd6qphyIhcxRDjZces105vyQ=; h=Subject:To:Cc:From:Date:List-ID:From; b=dGGf434mlruB+wPlUo3Kmhg8EHu6b1zoA80/Z2P10KUihYoA32Epzqxy89TQ+W9+H x2lubnwUpAOIr4twIr1BrgS5xZpB8IGMUTNi+fgFiMWzX76Zmve2ylQRh41fwPdHpl +vQRiB5GsMP863RkAles5+w+wCswpPMbDL3NoqNM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726125AbgIOHgj (ORCPT ); Tue, 15 Sep 2020 03:36:39 -0400 Received: from wforward4-smtp.messagingengine.com ([64.147.123.34]:36309 "EHLO wforward4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726122AbgIOHgi (ORCPT ); Tue, 15 Sep 2020 03:36:38 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id C3B837DB; Tue, 15 Sep 2020 03:36:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 15 Sep 2020 03:36:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ZcFydo q/c2WoZa8MNFS30LP7G9ZL3a36shsMLe6u/aE=; b=n1MsWzNYQANn6tqulQQbQW dHwgIYkAF8Euo/ShKbZkX0oxNMFHs2vdRr0WTKweGrtSJLsiLIot/+pXxRjwxi2x m3lWszw6xSXc0kPJcfcxb5vTs9gnp0XpCR3iC810mVx+sn176tqXKl2kgh/wwdOA 3/OVCySnLaTlrEvzivvj2sLYO8ORUYOv6uRy7xFv5Ub5tni7lPxkXDSmUO0OLvFx fTmDV1V1Xsogd8oDRWGwrqWTe5fQZ1Zsz3zzAgUz2Nr8VIzOt8AoAwgL85UMfywQ kk7yuA9BemssLN4FIh1pP764aEji4OZ6bH98FO5VZ1SIWNAu8oiq7tAXHXExKm3w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeijedguddukecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertd dttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdho rhhgqeenucggtffrrghtthgvrhhnpeelleelvdegfeelledtteegudegfffghfduffduud ekgeefleegieegkeejhfelveenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhp peekfedrkeeirdejgedrieegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id 0CD31328005E; Tue, 15 Sep 2020 03:36:35 -0400 (EDT) Subject: FAILED: patch "[PATCH] scsi: target: iscsi: Fix data digest calculation" failed to apply to 4.4-stable tree To: varun@chelsio.com, martin.petersen@oracle.com, michael.christie@oralce.com, stable@vger.kernel.org Cc: From: Date: Tue, 15 Sep 2020 09:36:34 +0200 Message-ID: <1600155394177226@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 5528d03183fe5243416c706f64b1faa518b05130 Mon Sep 17 00:00:00 2001 From: Varun Prakash Date: Tue, 25 Aug 2020 18:05:10 +0530 Subject: [PATCH] scsi: target: iscsi: Fix data digest calculation Current code does not consider 'page_off' in data digest calculation. To fix this, add a local variable 'first_sg' and set first_sg.offset to sg->offset + page_off. Link: https://lore.kernel.org/r/1598358910-3052-1-git-send-email-varun@chelsio.com Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1") Cc: Reviewed-by: Mike Christie Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index c9689610e186..2ec778e97b1b 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1389,14 +1389,27 @@ static u32 iscsit_do_crypto_hash_sg( sg = cmd->first_data_sg; page_off = cmd->first_data_sg_off; + if (data_length && page_off) { + struct scatterlist first_sg; + u32 len = min_t(u32, data_length, sg->length - page_off); + + sg_init_table(&first_sg, 1); + sg_set_page(&first_sg, sg_page(sg), len, sg->offset + page_off); + + ahash_request_set_crypt(hash, &first_sg, NULL, len); + crypto_ahash_update(hash); + + data_length -= len; + sg = sg_next(sg); + } + while (data_length) { - u32 cur_len = min_t(u32, data_length, (sg->length - page_off)); + u32 cur_len = min_t(u32, data_length, sg->length); ahash_request_set_crypt(hash, sg, NULL, cur_len); crypto_ahash_update(hash); data_length -= cur_len; - page_off = 0; /* iscsit_map_iovec has already checked for invalid sg pointers */ sg = sg_next(sg); }