From patchwork Thu Oct 10 08:35:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 175711 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1975107ill; Thu, 10 Oct 2019 01:39:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoFDGkkCq75fZxzP078Ga30w4WMtSjLwQ1c7BIqJ/XEBphtUtLlLEvS0BF/FzYcovkuznq X-Received: by 2002:a17:906:5e07:: with SMTP id n7mr6874918eju.271.1570696770871; Thu, 10 Oct 2019 01:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570696770; cv=none; d=google.com; s=arc-20160816; b=egI8cASZzDHxarZTAWrSoWCqqittwW1377XwaKzjGYIOi9G4annKsRmbzt5HqOHmoe OhhmqHWrU6KMTJS3haw259JwpRDI9O1RQt61HnfrddB5zO/U4M6pG8/MibG9yiMAeav2 0h1P/2uGweDQRindHH+hVyg951Mn+hLFgziqebzqrp/lG3bVAbjdILHL79ovOv/hQKDG HfPQkYffihfFMtIKlExgK2EjOG0BKSphRHeatcuSpkjqFwag+LWzeg+al76yJE375NnM mAeY7HtmUtKsatqj4jUGSIyXFataStwrDM/FQpxyOS5XOmp1ems4xKi4ppH7k/4sN32m pFVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oXRtJDQVCYqQepuBh63PyzDOl9HVm/TPbiVNbXxc1OI=; b=JWMDwycn8GlkAfQFFu0caR+lLEMBsTb0mFhxPxf/9t8SyoU5keiHIrMYdlNKnyGtW2 Wyc+pIPWv7+0jDTLgT7KCVsnxd9zFwjWW7RrkHf9r1IwKMC4fL4x5JTizmeurNWqeRec 1o2Y/e9nIinUoehd7qYNNMnWbZllv2o+X7LMnr9wCDSGlTvtXj0gDSU9xJ9GQv3eat7G ZJ+HJ20b4jJZA/ibm4v7I8x/crZCQq4nki/zOt0AltKuJigIRKX852vBlLDwNugACDuQ MeHhEx6s6/MoU1HmOAF5t1HHwq/hjV8w6qHz7/wC4JUZWzIytDFKvxkVo5Fv0UQTxEos LSgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="H/+3Oj3J"; 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 e6si2872415ejb.348.2019.10.10.01.39.30; Thu, 10 Oct 2019 01:39:30 -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="H/+3Oj3J"; 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 S2387880AbfJJIj3 (ORCPT + 26 others); Thu, 10 Oct 2019 04:39:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:42992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387430AbfJJIj2 (ORCPT ); Thu, 10 Oct 2019 04:39:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0B06E21D7A; Thu, 10 Oct 2019 08:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696767; bh=NROWJEU6vUCbpXiz1egOIyuqyJi8o/fjEm1WAP2iO8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H/+3Oj3JxOOsgeqZZpLMxk8j1DnYfKlZTElVCPBr34YyFJ2vbrFifS1VwgEriupRK wfBnilp59wcKjGKekRpeLiOX3NBS5wtka/UG+On8VJTtA/vyeWmgwxtjXlTbsZvYQU ro4O8I/clwyGRQohk5PC5nyVgN+sdt+pyuAA/PF4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gilad Ben-Yossef , Herbert Xu Subject: [PATCH 5.3 046/148] crypto: ccree - use the full crypt length value Date: Thu, 10 Oct 2019 10:35:07 +0200 Message-Id: <20191010083613.938277698@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gilad Ben-Yossef commit 7a4be6c113c1f721818d1e3722a9015fe393295c upstream. In case of AEAD decryption verifcation error we were using the wrong value to zero out the plaintext buffer leaving the end of the buffer with the false plaintext. Signed-off-by: Gilad Ben-Yossef Fixes: ff27e85a85bb ("crypto: ccree - add AEAD support") CC: stable@vger.kernel.org # v4.17+ Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/ccree/cc_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/crypto/ccree/cc_aead.c +++ b/drivers/crypto/ccree/cc_aead.c @@ -236,7 +236,7 @@ static void cc_aead_complete(struct devi /* In case of payload authentication failure, MUST NOT * revealed the decrypted message --> zero its memory. */ - cc_zero_sgl(areq->dst, areq_ctx->cryptlen); + cc_zero_sgl(areq->dst, areq->cryptlen); err = -EBADMSG; } } else { /*ENCRYPT*/