Patch "crypto: authencesn - Fix digest_null crash" has been added to the 4.9-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
crypto: authencesn - Fix digest_null crash
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
crypto-authencesn-fix-digest_null-crash.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
41cdf7a45389e01991ee31e3301ed83cb3e3f7dcMon Sep 17 00:00:00 2001
From: Herbert Xu <[email protected]>
Date: Mon, 17 Jul 2017 15:32:30 +0800
Subject: crypto: authencesn - Fix digest_null crash
From: Herbert Xu <[email protected]>
commit 41cdf7a45389e01991ee31e3301ed83cb3e3f7dc upstream.
When authencesn is used together with digest_null a crash will occur on the decrypt path. This is because normally we perform a special setup to preserve the ESN, but this is skipped if there is no authentication. However, on the post-authentication path it always expects the preservation to be in place, thus causing a crash when digest_null is used.
This patch fixes this by also skipping the post-processing when there is no authentication.
--- crypto/authencesn.c | 5 +++++ 1 file changed, 5 insertions(+)
crypto/authencesn.c +5 -0
@@ -248,6 +248,9 @@ static int crypto_authenc_esn_decrypt_tau8 *ihash = ohash +crypto_ahash_digestsize (auth);u32 tmp[2 ]; +if (!authsize) + goto decrypt; +/* Move high-order bits of sequence number back. */ scatterwalk_map_and_copy (tmp, dst,4 ,4 ,0 );scatterwalk_map_and_copy (tmp +1 , dst, assoclen + cryptlen,4 ,0 );
@@ -256,6 +259,8 @@ static int crypto_authenc_esn_decrypt_taif (crypto_memneq (ihash, ohash, authsize))return -EBADMSG ; +decrypt: +sg_init_table (areq_ctx->dst,2 ); dst =scatterwalk_ffwd (areq_ctx->dst, dst, assoclen);
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/crypto-authencesn-fix-digest_null-crash.patch