Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1988432imm; Thu, 24 May 2018 04:06:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq73W4adC/PLXATGVAV/y8sF0/esMIVfSGkZmmjV+2FlL5lLCkV6SUnBaKOqvBbkHulBLir X-Received: by 2002:aa7:83c7:: with SMTP id j7-v6mr6789471pfn.50.1527159985981; Thu, 24 May 2018 04:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527159985; cv=none; d=google.com; s=arc-20160816; b=iSNaH0gIIZnlk3N2UnK/v/7CzC00CAs7kLiFy1pXwkCZUXrBwogqST1uzDP6s+bGT6 rbunsyhZFJm0ZQ4gwguAMKQoEOJ9AtPIOfQj5G5NQwsWQuov56UcWHfHTuI1ZwwL/04Y GfB+cFK1wZbRg19IgkTft0dGNTB1YC5Lb5XgLY8k3Ro3zbfy36SZ3xd/3Y2y3CZx/dg0 o4mzgBGMEg5epgH0zujCXuoK4uSJ6JfxEaspdNtzUUYMRTGRLQ/k9CZbx+YWOEKizYVk 7iZmWQYyWSTmB2Nu3lQal6FdVnM7wqzRgBpTJ6A2HNslkQz72EMkAQxFBVw7eube7z4u esrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=4dz9N6LktgddLd1S5og9KTW4DWzcbustRShRGjf6vOw=; b=jLmcekvjK2SBg+GowoOHJPCKIk3WuPpdlh2Ns/NxSeSCPwXC+SUYgv5rJQ2SSG2dDp kiGnOXY1lFLGO65DBIHeUytheddwdJ0BZ39f2ovyaMCKunApfb6n3Fxej/lNchG32mrS q/3yAsRvA6uxwVAdL0xkS2xp2QXeok86YgwLX9qRdmX3DNnTuqOr6+F1i3AvIXVAHpTO mTNdee7uP4iBp5/zt67tTsSNz8cPhR+EDbGdwpNQilL9nFtv15P5QPnE9Z2ye4tkdBA6 kUws/LVYagpbzBqd7zcSvCcyhxgKpLdIaPdp6Yw/QMuJEh2btLMSPD2pmQmREU3dO/Zw 2m4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gvTlJrdk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a92-v6si21196521pla.291.2018.05.24.04.06.11; Thu, 24 May 2018 04:06:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gvTlJrdk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968543AbeEXLEW (ORCPT + 99 others); Thu, 24 May 2018 07:04:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:35570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968067AbeEXJz3 (ORCPT ); Thu, 24 May 2018 05:55:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8739D20892; Thu, 24 May 2018 09:55:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155729; bh=v7DQMPN8f4ldwm86ncdv24Rgj9VlEGKixLHbqGB2B6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gvTlJrdknOddMkfmT0rYTq81CX3FxoipZ1G/OHLfU/vHPhpzd9ZWZm/1IdToHbJZj sLiItPuTYRSt9jrZNo5x8nZzLlzf+vvRZNuLhRNp0zNnn8t4Ufj31HLoIsw7cX7PJK goZfd6nUfq6l62/djYwAx0Wwhw1OrSzp1nYNhDU8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Antoine Tenart , Herbert Xu , Sasha Levin Subject: [PATCH 4.14 096/165] crypto: inside-secure - fix the extra cache computation Date: Thu, 24 May 2018 11:38:22 +0200 Message-Id: <20180524093625.906068230@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Antoine Tenart [ Upstream commit c1a8fa6e240ed4b99778d48ab790743565cb61c8 ] This patch fixes the extra cache computation when the queued data is a multiple of a block size. This fixes the hash support in some cases. Fixes: 809778e02cd4 ("crypto: inside-secure - fix hash when length is a multiple of a block") Signed-off-by: Antoine Tenart Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/inside-secure/safexcel_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -199,7 +199,7 @@ static int safexcel_ahash_send_req(struc /* If this is not the last request and the queued data * is a multiple of a block, cache the last one for now. */ - extra = queued - crypto_ahash_blocksize(ahash); + extra = crypto_ahash_blocksize(ahash); if (extra) { sg_pcopy_to_buffer(areq->src, sg_nents(areq->src),