Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1420370 > unrolled thread

[PATCH 3.2 06/46] crypto: gcm - Fix rfc4543 decryption crash

Started byBen Hutchings <ben@decadent.org.uk>
First post2016-06-12 23:50 +0200
Last post2016-06-12 23:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.2 06/46] crypto: gcm - Fix rfc4543 decryption crash Ben Hutchings <ben@decadent.org.uk> - 2016-06-12 23:50 +0200

#1420370 — [PATCH 3.2 06/46] crypto: gcm - Fix rfc4543 decryption crash

FromBen Hutchings <ben@decadent.org.uk>
Date2016-06-12 23:50 +0200
Subject[PATCH 3.2 06/46] crypto: gcm - Fix rfc4543 decryption crash
Message-ID<rJlqy-5ve-37@gated-at.bofh.it>
3.2.81-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Herbert Xu <herbert@gondor.apana.org.au>

This bug has already bee fixed upstream since 4.2.  However, it
was fixed during the AEAD conversion so no fix was backported to
the older kernels.

When we do an RFC 4543 decryption, we will end up writing the
ICV beyond the end of the dst buffer.  This should lead to a
crash but for some reason it was never noticed.

This patch fixes it by only writing back the ICV for encryption.

Fixes: d733ac90f9fe ("crypto: gcm - fix rfc4543 to handle async...")
Reported-by: Patrick Meyer <patrick.meyer@vasgard.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 crypto/gcm.c | 3 +++
 1 file changed, 3 insertions(+)

--- a/crypto/gcm.c
+++ b/crypto/gcm.c
@@ -1176,6 +1176,9 @@ static struct aead_request *crypto_rfc45
 	aead_request_set_tfm(subreq, ctx->child);
 	aead_request_set_callback(subreq, req->base.flags, crypto_rfc4543_done,
 				  req);
+	if (!enc)
+		aead_request_set_callback(subreq, req->base.flags,
+					  req->base.complete, req->base.data);
 	aead_request_set_crypt(subreq, cipher, cipher, enc ? 0 : authsize, iv);
 	aead_request_set_assoc(subreq, assoc, assoclen);
 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web