From patchwork Mon Nov 30 13:03:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 7724121 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8150CBEEE1 for ; Mon, 30 Nov 2015 13:18:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F32D20534 for ; Mon, 30 Nov 2015 13:18:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D2332046F for ; Mon, 30 Nov 2015 13:18:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752067AbbK3NSg (ORCPT ); Mon, 30 Nov 2015 08:18:36 -0500 Received: from mail-by2on0140.outbound.protection.outlook.com ([207.46.100.140]:60736 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752017AbbK3NSf (ORCPT ); Mon, 30 Nov 2015 08:18:35 -0500 X-Greylist: delayed 868 seconds by postgrey-1.27 at vger.kernel.org; Mon, 30 Nov 2015 08:18:34 EST Received: from BY2PR03CA009.namprd03.prod.outlook.com (10.255.93.26) by BLUPR03MB568.namprd03.prod.outlook.com (10.141.78.22) with Microsoft SMTP Server (TLS) id 15.1.331.20; Mon, 30 Nov 2015 13:04:05 +0000 Received: from BN1BFFO11OLC003.protection.gbl (10.255.93.4) by BY2PR03CA009.outlook.office365.com (10.255.93.26) with Microsoft SMTP Server (TLS) id 15.1.331.20 via Frontend Transport; Mon, 30 Nov 2015 13:04:05 +0000 Authentication-Results: spf=permerror (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; Received-SPF: PermError (protection.outlook.com: domain of freescale.com used an invalid SPF mechanism) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11OLC003.mail.protection.outlook.com (10.58.145.14) with Microsoft SMTP Server (TLS) id 15.1.331.11 via Frontend Transport; Mon, 30 Nov 2015 13:04:04 +0000 Received: from fabio-Latitude-E6410.am.freescale.net (fabio-Latitude-E6410.am.freescale.net [10.29.244.83]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id tAUD41XM031616; Mon, 30 Nov 2015 06:04:02 -0700 From: Fabio Estevam To: CC: , , "Fabio Estevam" Subject: [PATCH] crypto: caam - pass the correct buffer length Date: Mon, 30 Nov 2015 11:03:58 -0200 Message-ID: <1448888638-7921-1-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11OLC003; 1:Rq4bqpBn+u/oJ581exANJz4S8RT/8FpVtQIT9E4I1R7vIKBCBQPL84hSveCVpQBObWzPvyLcPCACTxZrjtJ+3P2LQmAb/GmEWxnwmSxX+wxKB2wBRmlfIy6WW342MIUJeiXeBs5oWZ/7ArgNu2sd5Y3QtUqzfO0ahg0U/FxFuAcEfWNn+GcgtOUxUAuiVWjriSzmC1byq+NKDTJ12OBW4F2YuTzmCm5X0/nyP5YBOWRyuPM9O3BCSfeTELsa+xHkueNEufZFLTDZMepETzWjzzR7xrQvPBPvkctiqyrfujSi+ZjmeopyXEOU+T2ox/fyXSUfqs75NklNl6oxFh1ajHbMEUW4gwwkLcgofFB4FdwOnuRKN099rgNG9u8fr3J+Q7bg5yCW4i6gYudrM8lcWB/YiF3BV2twbqIQAyVk5wE= X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(448002)(199003)(189002)(50986999)(586003)(47776003)(92566002)(19580395003)(87936001)(1096002)(189998001)(77096005)(85326001)(107886002)(19580405001)(97736004)(11100500001)(81156007)(106466001)(2351001)(4001430100002)(6806005)(50466002)(104016004)(110136002)(86362001)(48376002)(229853001)(33646002)(5001960100002)(36756003)(5003940100001)(5008740100001)(1220700001)(50226001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB568; H:tx30smr01.am.freescale.net; FPR:; SPF:PermError; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB568; 2:QsQOahA4bf1aBl5ScCSy2v62cdMu4ekzuJ7G0US4RKMFERn4d6civi7VDOj0iPT5SRrbVzcKHCFXpZ9Pvb1kQFfbiPu+4k1XLrnkp4ZTwGNCgqmgu+TnvtI7DeAmTj6HDac8C88XIqpS3UT0jSeDgw==; 3:gItpipzK16w+0rcyY1+FqB3CEgjlsp0x8al85ZY0oaBhzH5gP42S3cssUZfuMm6ByWkFOQvgwQTE6SGnbpiKLiPGilKFgcoUGUuhrALNlBiUwD/ynS2wLhOGsGm+iP1gRmSXKaOg7LEQWAgSqCZzGeLzBT5D7hHzuYJjNlzKXGlTDYG1i+q0rmvanUFXR4QUGMYj1nzbBB2pUNW23q4qGnGGLgKGnr9b0n7TIQcCJ9E=; 25:EE9oU0KFycqPVleXkYdGxapSsmvnv6FZampH2wgIVlfIa8/z/bOJRfBca72bLYe3o0EWYw+ekISvsgge/PN8QtRYNvu2LwjpH+HOBeyZDplyS82jdNSjFWd4+dCNNRIRN2kYFd/AtTLZta76YkBdniy1snK3612u9sRcqI4UNdTWgg7d/9Z1Jar3AEXIwlL3C7qGRGopuUMkO7gQfwmTIi6LWbl+MAlsPkPw2YwDvlKLXPpBDRKcT36hDyFG4Kg9L8bPJrw6oT2+zCLtYYjFKw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB568; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB568; 20:Gz9s5NeomWECrH4L7xBKNcFqqlYTmT1YMJqUYDE9GI7hS9eLs7vH3SEG29QigpmBlLVeUkQSt2yYvsutu2Euc2YFOMLUX7xDYmD/J+cHRN25MXieFbgTSay6Qv9CZGD5G1dXk497hx5yYomHA+EDtNDol2qSA8rMlCJ26W0R2IQxlGrotFip8cHhkRqJiED243aF+9RlL334hdoXo2VT2lXxDQ7k208uxuxZPaeuJl2UJ4Ccy0LlZaupC+chotIhnQ9u0yylYaqzjo9zzifltoyKo+m1NkMRquFl0E7VLbYAdax8e3nO7LfbwMYwxE84098VmyrRdWtlYDfet0CDe9n8QkfhXihBbtaVrGqkDaI=; 4:qtVQfGGDsSEUoOajlt0qQla/VdvEeBjBIB2k/UVdbvafMhDEebVxxc7YbW/w7tomOgHzeTypuak/BpzDGobWTDqwOCv+x0MxvSSAkjfR/3zio9+QDsMV7/OXFSEasOkXwxfN+XrEykg5BijxrfvuJ4mIlL0FhxexVRoIL6xDc8T2ErqI/C7aiLSRKpsCdfhEt3JSh89aDI/U02zYIxz053q4vBtoi51fisVme13dL9EWfG+Bszwsem1VySmPLEV2UEa5Ewo5+fstGTsjxpMCWHiV+n3G/bACQnT9xdsAnoc0uaMhk1AlCCEj0xHbgkCfwvtX6Lj0aU27yUPsrOAxFpRLHyquz54Azczg6ceq6v89oj+iVGN5yF1gquxDAb1wxUL89CbFqa+DmWcnSISdaQfyNSMVEXiDa9mbLg71mOBsUOriCsIEwd4t3dYjQ8KK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046); SRVR:BLUPR03MB568; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB568; X-Forefront-PRVS: 0776C39A48 X-Microsoft-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WvaUPV5kuLDBWlASC+4iHeixsivOOLkL10rQawAYOvxvVQuFNNRyHamzdY?= =?us-ascii?Q?B+onEROHiUAYLdXU9bc57R4RpyEKKi1kckVXNDav93w20TYRWJirfCKrXb9J?= =?us-ascii?Q?R1hHrgXAPmmRxEYGsi+W0YsZMX3myimz7mkhtxJ+HSNWgCm2zU/DKGiHggId?= =?us-ascii?Q?rpj/1wo9BnUDHarshlBw9b?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB568; 5:lQKq5zBTzALv5OFdGI3T6KPgpi2Ataufh5cHhBSz7xInoatk++z/RRsG5J//A9w0kXs88zhE1Vp2o4ulqq7JDcOOzNKp8qxQeQSVpmGFfbwFukBwo8s7fmb21FhNGooFW3Qq+3CGTrqSul7m5OkG7g==; 24:4xN2koXSdi5pTO1o7kq2EZfqAZTsfP4hed/iHMIJN3MPqLGEbP3h2CCS9aP9nHuBSGFNDSaqq1BIZenkHv2quIbBkvKJ9aAy+RvrkyB8Vtk= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2015 13:04:04.1870 (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: BLUPR03MB568 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 When buffer 0 is used we should use buflen_0 instead of buflen_1. Fix it. Signed-off-by: Fabio Estevam --- Untested. drivers/crypto/caam/caamhash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index fe9c156..5845d4a 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -1596,7 +1596,7 @@ static int ahash_export(struct ahash_request *req, void *out) len = state->buflen_1; } else { buf = state->buf_0; - len = state->buflen_1; + len = state->buflen_0; } memcpy(export->buf, buf, len);