linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>
Cc: Ofir Drang <ofir.drang@arm.com>, Hadar Gat <hadar.gat@arm.com>,
	stable@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 03/11] crypto: ccree - fix AEAD decrypt auth fail
Date: Thu, 16 Jan 2020 12:14:38 +0200	[thread overview]
Message-ID: <20200116101447.20374-4-gilad@benyossef.com> (raw)
In-Reply-To: <20200116101447.20374-1-gilad@benyossef.com>

On AEAD decryption authentication failure we are suppose to
zero out the output plaintext buffer. However, we've missed
skipping the optional associated data that may prefix the
ciphertext. This commit fixes this issue.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Fixes: e88b27c8eaa8 ("crypto: ccree - use std api sg_zero_buffer")
Cc: stable@vger.kernel.org
---
 drivers/crypto/ccree/cc_aead.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/ccree/cc_aead.c b/drivers/crypto/ccree/cc_aead.c
index d014c8e063a7..754de302a3b5 100644
--- a/drivers/crypto/ccree/cc_aead.c
+++ b/drivers/crypto/ccree/cc_aead.c
@@ -237,7 +237,7 @@ static void cc_aead_complete(struct device *dev, void *cc_req, int err)
 			 * revealed the decrypted message --> zero its memory.
 			 */
 			sg_zero_buffer(areq->dst, sg_nents(areq->dst),
-				       areq->cryptlen, 0);
+				       areq->cryptlen, areq->assoclen);
 			err = -EBADMSG;
 		}
 	/*ENCRYPT*/
-- 
2.23.0


  parent reply	other threads:[~2020-01-16 10:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 10:14 [PATCH 00/11] crypto: ccree - fixes and cleanups Gilad Ben-Yossef
2020-01-16 10:14 ` [PATCH 01/11] crypto: ccree: fix typos in error msgs Gilad Ben-Yossef
2020-01-16 10:14 ` [PATCH 02/11] crypto: ccree: fix typo in comment Gilad Ben-Yossef
2020-01-16 10:14 ` Gilad Ben-Yossef [this message]
2020-01-16 10:14 ` [PATCH 04/11] crypto: ccree - turn errors to debug msgs Gilad Ben-Yossef
2020-01-16 10:14 ` [PATCH 05/11] crypto: ccree - fix pm wrongful error reporting Gilad Ben-Yossef
2020-01-16 10:14 ` [PATCH 06/11] crypto: ccree - cc_do_send_request() is void func Gilad Ben-Yossef
2020-01-16 10:14 ` [PATCH 07/11] crypto: ccree - fix FDE descriptor sequence Gilad Ben-Yossef
2020-01-16 10:14 ` [PATCH 08/11] crypto: ccree - fix PM race condition Gilad Ben-Yossef
2020-01-16 10:14 ` [PATCH 09/11] crypto: ccree - split overloaded usage of irq field Gilad Ben-Yossef
2020-01-16 10:14 ` [PATCH 10/11] crypto: ccree - make cc_pm_put_suspend() void Gilad Ben-Yossef
2020-01-16 10:14 ` [PATCH 11/11] crypto: ccree - erase unneeded inline funcs Gilad Ben-Yossef
2020-01-22 10:13 ` [PATCH 00/11] crypto: ccree - fixes and cleanups Herbert Xu
2020-01-22 16:51 ` Geert Uytterhoeven
2020-01-23 11:44   ` Gilad Ben-Yossef
2020-01-23 15:46     ` Geert Uytterhoeven
2020-01-23 18:18       ` Gilad Ben-Yossef
2020-01-23 20:08         ` Geert Uytterhoeven
2020-01-26 13:37           ` Gilad Ben-Yossef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200116101447.20374-4-gilad@benyossef.com \
    --to=gilad@benyossef.com \
    --cc=davem@davemloft.net \
    --cc=hadar.gat@arm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ofir.drang@arm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).