Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1929543imm; Thu, 24 May 2018 03:06:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq34g4gGvLujiATiOrxob1xD5CQ0q5LsmilVWimsNQMuIHFNNRLgMa4C0EOTQJgzvOxwIg9 X-Received: by 2002:a62:1397:: with SMTP id 23-v6mr6623790pft.222.1527156383598; Thu, 24 May 2018 03:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527156383; cv=none; d=google.com; s=arc-20160816; b=giHCDfnKwAzHK2aT9Oyt5X9CoI/0cZ4sPo4xadztotDyz8IPXMW29nFygPJii/MYZe wiZ6rQD3yXcw6yYZkalWO4/e/GacZPyhMSLUAD417GcdXLkIih75d63CKUesEw4wYq/1 lxvSRr1+zsmZc3s7svCDopFBr1jAZK6M6sFtd9YRWm3FM4HFTelKuorgmBbI5bfXuL+M paTczYsbllOyuDyF2sxDF+3p0b26phqfcOcdwcOe6zFqp8UMdPEoTmuKTNDhLf5ImDIZ mzEoPWhm+V3h5MRN1x1L9WH782NsCvAin0T5SQieWQxvb39zJ0NQ4qQIUSxA8v4UgFVB wcMw== 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=3wCOoH004G5NyScQ0gl5zL2AxEganViJbjK6e4avCmc=; b=ORiEv3HXqIkwJu32s3fXkN3t/AozHvRmI4vgslFbvEkbW2fh5GclT+g6xGonEd/r44 D02fygIYr6FLeXMy7bPHh7rGhvNt8rS+Ivbu8LAmTfaoSoizIXbFVGz+835SBkF65OV2 GvLEAiV6+/LuKj6ZdiCHvTTlfx9ogofmdKfz0LbiKLXnyF6XkTbnRuMLn6kko72TPeIO wXfq1zXC1xNUm1h4ysk6qxwjT9QevZVVgEIsMm47yWygPBC5mzxpB/nGpZQqCvxnufgJ +vGuSpkGNRtXA3h864EIDznGQjNB6TdoJOjjlzh6NhiHBSZOoqeehC8Td5mE5BMLv9Hn QPqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e/03UVrI; 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 e26-v6si20902773pfb.185.2018.05.24.03.06.07; Thu, 24 May 2018 03:06:23 -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=e/03UVrI; 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 S1031529AbeEXKFP (ORCPT + 99 others); Thu, 24 May 2018 06:05:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:54314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031507AbeEXKFF (ORCPT ); Thu, 24 May 2018 06:05:05 -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 9FFE520896; Thu, 24 May 2018 10:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156305; bh=09c7Y7/1UZECKL69hhdIJ7msDcL4qa0svqRMIeq7tJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e/03UVrIcbYRd/vgsWK5hzfX23HfEtsDy7LbB9sX3B7XhSB7rZqgFYWDP1lNS2WJf ptOP1vB8Y7wVZLwiEQKpBxfrtio4lzq/uajrMn5i4g28S8PAHk4m2wzvrJ3IPsrnuO NLRNCYBENqTACyVmxQWc/g/F/a7OD9YRrxGIOLpo= 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.16 103/161] crypto: inside-secure - fix the extra cache computation Date: Thu, 24 May 2018 11:38:48 +0200 Message-Id: <20180524093030.746688522@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@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.16-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 @@ -201,7 +201,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),