Message ID | 1438228709-27650-7-git-send-email-vicki.milhoan@freescale.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Herbert Xu |
Headers | show
Return-Path: <linux-crypto-owner@kernel.org> X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7A0069F380 for <patchwork-linux-crypto@patchwork.kernel.org>; Thu, 30 Jul 2015 03:58:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 87B7A204D8 for <patchwork-linux-crypto@patchwork.kernel.org>; Thu, 30 Jul 2015 03:58:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83C5620515 for <patchwork-linux-crypto@patchwork.kernel.org>; Thu, 30 Jul 2015 03:58:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752703AbbG3D6j (ORCPT <rfc822;patchwork-linux-crypto@patchwork.kernel.org>); Wed, 29 Jul 2015 23:58:39 -0400 Received: from mail-bl2on0111.outbound.protection.outlook.com ([65.55.169.111]:13152 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752727AbbG3D6i (ORCPT <rfc822;linux-crypto@vger.kernel.org>); Wed, 29 Jul 2015 23:58:38 -0400 Received: from BY2PR03CA001.namprd03.prod.outlook.com (10.255.93.18) by DM2PR03MB573.namprd03.prod.outlook.com (10.141.83.28) with Microsoft SMTP Server (TLS) id 15.1.225.19; Thu, 30 Jul 2015 03:58:35 +0000 Received: from BL2FFO11FD009.protection.gbl (10.255.93.4) by BY2PR03CA001.outlook.office365.com (10.255.93.18) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Thu, 30 Jul 2015 03:58:35 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; arm.linux.org.uk; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD009.mail.protection.outlook.com (10.173.161.15) with Microsoft SMTP Server (TLS) id 15.1.231.11 via Frontend Transport; Thu, 30 Jul 2015 03:58:35 +0000 Received: from stc-hedley.am.freescale.net (stc-hedley.am.freescale.net [10.67.70.12]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t6U3wUbf025418; Wed, 29 Jul 2015 20:58:34 -0700 From: Victoria Milhoan <vicki.milhoan@freescale.com> To: <linux-crypto@vger.kernel.org> CC: <herbert@gondor.apana.org.au>, <horia.geanta@freescale.com>, <ruchika.gupta@freescale.com>, <shawnguo@kernel.org>, <kernel@pengutronix.de>, <linux@arm.linux.org.uk> Subject: [PATCH 06/12] crypto: caam - Correct DMA unmap size in ahash_update_ctx() Date: Wed, 29 Jul 2015 20:58:23 -0700 Message-ID: <1438228709-27650-7-git-send-email-vicki.milhoan@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1438228709-27650-1-git-send-email-vicki.milhoan@freescale.com> References: <1438228709-27650-1-git-send-email-vicki.milhoan@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD009; 1:KVqORirmzgnZImWn3jbqo4dAJ2eqLE5Zpiiz5a5ba52vhXcHhT0KL1WJhJRZ4hoZWkZMEt5TdDPQPwaFoN7Pc1NqPZt11rK25qMxsqxrsqJFSX7ZhJAwMLzugi/UWlOLd33GTRQYBd0I1O4mqIDq+W0Zs8rWEIyVnM0MapTg9A67/dHheqc0GIvL5Ph1kHMnMNNs1SGvGSjacEnlKyXfiu5jPnC4TZ64tpV2MrjQMZN/1JS8VEDK1Dm/0BOQ2Vi5+fAhAbG8UgOvROiOjZxdbx+Y2AYBN4fu3lGHiWO1sLrZDlRd9bO45NCxe3lcLZIzKlmN8OgVOmF6nCars0MePg== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(85426001)(46102003)(189998001)(36756003)(50466002)(48376002)(2950100001)(77096005)(87936001)(86362001)(76176999)(50986999)(575784001)(6806004)(110136002)(5001920100001)(5001960100002)(19580395003)(19580405001)(92566002)(229853001)(77156002)(104016003)(62966003)(106466001)(2351001)(33646002)(50226001)(47776003)(105606002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR03MB573; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB573; 2:+ivv9Y967nMm9zH4DHf7a4H1+fIDnkavhWAp7NqHUoV4jaeIv+ORaeUfl9HXXkwUMTJHGoeI+cLJ2/vfWK0RcSFEqhFR+7OgLNVRdls4FtYNl9AurJG4PWWSoej6HkQi+XiDe2SgKGb0eocuvz7qLdLXmoNEbqyeCG1U+G3CXd0=; 3:GipxMCcjr0ea43a+6Oi2P+iI13pgG6k0IvfpB4WU4XqXPiVU0wjUFLbRtlMyvIVnEJDRDUcHLjz94Q4mq2WkMyqOdKV5JlfnsntMb2B2drYiw7XPvZ/CYxDnt2jRsp0glREY/0xB7vCZBVyKO1V3vjRksalf5eeBXGMUVM3xvSG8/usTq4SZC49XbfTXCt1s+2++DXjcDCi110dmn1+x4FIrMqDSlXWRGFvBJWObA0Y=; 25:WXop8lfUPkdUr61AWXMjUdnOJtHgBe5UCPMbkd+2i0m0oLuujjWHbR99yp4WojcyjUAY5UxG8fyvDH1a8hGb9fJDUDlH9DAKAX8ywo+ndCAc/Sc1HNVYfxL0il6kMcg03IwBjf84ZAlu9PO/cSOTiHDpi9OtlRBtPr0jeyZV75BSKkdBRBdhjAbT4dXLtymYFH7EOMbwzTfMSgPJ5zs5swIUF/KYqF5wHWCHnVwTQLdEaghMeY9WwJFmUbuwlJY1dpc5B+TJ7pwXrRC7oKgdxQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB573; X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB573; 20:i6D28pJC8+DQPpFLi0P/Dyer9kgI7s4Oqs//yBWfOHzka/RTtupzHNnjV1lnhs159/5oHaKt22IuOyFCXFzo8kNlCEchTAaEwyH8bPDHNDzP1JYpvDrMX1oY82own/VspjXYvsVt9Idol1s4GWxP0r4DqwsEF45W+WVaeWtzWuAUBjNhzzlTYdul6PzUQ3xKzVNR+WDQxGfSSN4c78ixmFm5R1aqwvltGWUGPCGyiFHljHQu1jZ7vpmgfwAli9tQUFBwRW489O51WysCriqMtHim4W8DdAXDVFh3raIprF8fCxLVOITt5zsZYJ2lMrr9whuXeDvRL3bbU5UQR+kMrZYR/3v9xBHMGvpfjZD/f4w=; 4:mIrGDRaJJ2GyfDRFlOGgVsvSdCFpCXHZzTCBBgUe3XckmdiK3Y6NzhjLNLppHiZN7AR9halUIPpQBY7bz+QE0q0TjogsTwGtf3GHUY5e4RlFUnORjHxRDcz/Ru+PlEtQvCCxy3U9DGtkjP0VgxNtqL0TjHHVTX9TlMER0pW1IvQpJGonBvESHYrrBHgC0++ufToouLSSQZ7Z3FoJaZ7Gv3WtoRpyvolwf4TWrosr11sqSJgZ9J29+T6ImI/RshBVABhJCwOmGdquAdPmS5w6OFfnq/+lv3YnD8/QdG1kj78= X-Microsoft-Antispam-PRVS: <DM2PR03MB573E00ACAE6ABA8BAA4A019E98B0@DM2PR03MB573.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DM2PR03MB573; BCL:0; PCL:0; RULEID:; SRVR:DM2PR03MB573; X-Forefront-PRVS: 06530126A4 X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB573; 23:G/kXp+ZMqdBMSf4ezob+LjDH8jUnL6eE41RDnLmjb0AgR0XkCkO/0QhBotdRG6ICgHp4CVhgWHmVr4PTFXkj/06g6yWeYDsE1N00UZ3oXJzeCcHtivjTlSrgL29JofC8PQStXl+3COLtp+6RJyc7iGRTm5Boy9zW8MAm3rfIPNOdiDr4c/KeclbzrZaIVnuPJpsk143h8PS5r1Z5Ukqn88uZY2S9w3BUuLzsb32EODHOBT1CaxxlkAvx8JD+wYV5h6cC7DdJF62XtY2ind70TIL5FfDTI2OD2c8cHeyCAG4N+I9GbE1c1WsWW/JgHWGEYjmIAnZs9VG75xP28vgi3YkxBh/PvQI9mwtumzi2/ILYP//WNT6NKomDcUs04yFelhi8IFtsRcjJ0BwtEzvFXAI5BETZdjNFTyPy94RcGK+rlJPDoHdCUNMSowJO7d1HIfVmghbX1ZuyVz3Qocf08d2na7NP0w83KRGJ/E4ME1XyC+Opp2lxBmi6C+f9pczytJYBptUP0Xf3e0qgSMofzihbGha/fBG00ZsQDvkHQtyzAjOX/ufC9N1FiKGe73WOTkD0ePvl8uSL12mcERpUdqADinz62aPKUllc5QjhHx8MAPe7zUNLB5RMf3lbkAuEIf2IKGsL+HciA0sT0qo+bsYKncVxZskkpxN8K8EWS7O+arVuAeBN16rbcy0n+/x6c64w6h/c23jmcBz+jVcJbQ5uVdceKhQp04Fx9hgWaLGlfUYWKFva0jMa56nlQ++Q6d5erY1L3+Y9oTdXZN0WPryXxMCwHG7UF6nm7ziS6D139CjK++UfPLbifIoP0/hb+vCN9fxc/IW7DYG6a3Rn5CDdE05MiTpDRPA3dDhQ7mnNcIVM+0U9bKMnB4pzrbnmAshrukH+q0QNa/HEsgf4qxsWgKZPmC9YAVkSQoC3Lf 0= X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB573; 5:o1PW/fHmAi/fRAm/LB2ToyT+aETVQWv/n+s7P2892y6IunqMGrVgFXWMFIPYHlr+tv5Nlp93qecr7Q+ecCqMVknS2RbDpgrYVuZVKDcnXMtpsbRI0WEIxVQ9R3YUPGyhrl0/YBXhwnhyrkN4ait9BA==; 24:oFRE1If10x8s+tirVVwYfs/mD8Zb2fDPVo73pFdHuzq7GgkvhJnnQ0wBnt19a8Noqku5rkqs0pQTnP4W3iklTXRZC/NcsKeutcYXnSGtttc=; 20:mwyn22Wcco/3JgKjcLpK4MwvRAsY6kULwwcT+tpsHgw3g5G4wvkVXjYwMLDI3+/izk8Zwy5FuT8fw86vScRL+A== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2015 03:58:35.2401 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB573 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: <linux-crypto.vger.kernel.org> X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 2361beb..16c03f8 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -829,7 +829,7 @@ static int ahash_update_ctx(struct ahash_request *req) state->buf_dma = try_buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, buf, state->buf_dma, - *buflen, last_buflen); + *next_buflen, *buflen); if (src_nents) { src_map_to_sec4_sg(jrdev, req->src, src_nents,
This change fixes: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 456 at lib/dma-debug.c:1103 check_unmap+0x438/0x958() caam_jr 2101000.jr0: DMA-API: device driver frees DMA memory with different size [device address=0x000000003a241080] [map ] Modules linked in: tcrypt(+) CPU: 0 PID: 456 Comm: insmod Not tainted 4.1.0-248766-gf823586-dirty #82 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [<80015e0c>] (unwind_backtrace) from [<80012764>] (show_stack+0x10/0x14) [<80012764>] (show_stack) from [<806df8e8>] (dump_stack+0x84/0xc4) [<806df8e8>] (dump_stack) from [<800266fc>] (warn_slowpath_common+0x84/0xb4) [<800266fc>] (warn_slowpath_common) from [<8002675c>] (warn_slowpath_fmt+0x30/0x40) [<8002675c>] (warn_slowpath_fmt) from [<802c7db8>] (check_unmap+0x438/0x958) [<802c7db8>] (check_unmap) from [<802c835c>] (debug_dma_unmap_page+0x84/0x8c) [<802c835c>] (debug_dma_unmap_page) from [<804d3b94>] (ahash_update_ctx+0xb08/0xec4) [<804d3b94>] (ahash_update_ctx) from [<7f002984>] (test_ahash_pnum.isra.9.constprop.19+0x2b8/0x514 [tcrypt]) [<7f002984>] (test_ahash_pnum.isra.9.constprop.19 [tcrypt]) from [<7f005998>] (do_test+0x2db8/0x37cc [tcrypt]) [<7f005998>] (do_test [tcrypt]) from [<7f00b050>] (tcrypt_mod_init+0x50/0x9c [tcrypt]) [<7f00b050>] (tcrypt_mod_init [tcrypt]) from [<80009730>] (do_one_initcall+0x8c/0x1d4) [<80009730>] (do_one_initcall) from [<806dda4c>] (do_init_module+0x5c/0x1a8) [<806dda4c>] (do_init_module) from [<80085308>] (load_module+0x17e0/0x1da0) [<80085308>] (load_module) from [<80085998>] (SyS_init_module+0xd0/0x120) [<80085998>] (SyS_init_module) from [<8000f4c0>] (ret_fast_syscall+0x0/0x3c) ---[ end trace 60807cfb6521c79f ]--- Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com> --- drivers/crypto/caam/caamhash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)