Skip to content

Commit 04fd516

Browse files
committed
crypto: authencesn - Do not place hiseq at end of dst for out-of-place decryption
jira KERNEL-949 cve CVE-2026-31431 Rebuild_History Non-Buildable kernel-4.18.0-553.123.1.el8_10 commit-author Herbert Xu <herbert@gondor.apana.org.au> commit e024941 Empty-Commit: Cherry-Pick Conflicts during history rebuild. Will be included in final tarball splat. Ref for failed cherry-pick at: ciq/ciq_backports/kernel-4.18.0-553.123.1.el8_10/e0249411.failed When decrypting data that is not in-place (src != dst), there is no need to save the high-order sequence bits in dst as it could simply be re-copied from the source. However, the data to be hashed need to be rearranged accordingly. Reported-by: Taeyang Lee <0wn@theori.io> Fixes: 104880a ("crypto: authencesn - Convert to new AEAD interface") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Thanks, Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit e024941) Signed-off-by: Jonathan Maple <jmaple@ciq.com> # Conflicts: # crypto/authencesn.c
1 parent 50a4620 commit 04fd516

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
crypto: authencesn - Do not place hiseq at end of dst for out-of-place decryption
2+
3+
jira KERNEL-949
4+
cve CVE-2026-31431
5+
Rebuild_History Non-Buildable kernel-4.18.0-553.123.1.el8_10
6+
commit-author Herbert Xu <herbert@gondor.apana.org.au>
7+
commit e02494114ebf7c8b42777c6cd6982f113bfdbec7
8+
Empty-Commit: Cherry-Pick Conflicts during history rebuild.
9+
Will be included in final tarball splat. Ref for failed cherry-pick at:
10+
ciq/ciq_backports/kernel-4.18.0-553.123.1.el8_10/e0249411.failed
11+
12+
When decrypting data that is not in-place (src != dst), there is
13+
no need to save the high-order sequence bits in dst as it could
14+
simply be re-copied from the source.
15+
16+
However, the data to be hashed need to be rearranged accordingly.
17+
18+
Reported-by: Taeyang Lee <0wn@theori.io>
19+
Fixes: 104880a6b470 ("crypto: authencesn - Convert to new AEAD interface")
20+
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
21+
22+
Thanks,
23+
24+
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
25+
(cherry picked from commit e02494114ebf7c8b42777c6cd6982f113bfdbec7)
26+
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
27+
28+
# Conflicts:
29+
# crypto/authencesn.c
30+
diff --cc crypto/authencesn.c
31+
index a7c345f88223,c0a01d738d9b..000000000000
32+
--- a/crypto/authencesn.c
33+
+++ b/crypto/authencesn.c
34+
@@@ -244,10 -204,10 +244,11 @@@ static int crypto_authenc_esn_decrypt_t
35+
struct skcipher_request *skreq = (void *)(areq_ctx->tail +
36+
ctx->reqoff);
37+
struct crypto_ahash *auth = ctx->auth;
38+
- u8 *ohash = areq_ctx->tail;
39+
+ u8 *ohash = PTR_ALIGN((u8 *)areq_ctx->tail,
40+
+ crypto_ahash_alignmask(auth) + 1);
41+
unsigned int cryptlen = req->cryptlen - authsize;
42+
unsigned int assoclen = req->assoclen;
43+
+ struct scatterlist *src = req->src;
44+
struct scatterlist *dst = req->dst;
45+
u8 *ihash = ohash + crypto_ahash_digestsize(auth);
46+
u32 tmp[2];
47+
@@@ -305,17 -268,6 +311,20 @@@ static int crypto_authenc_esn_decrypt(s
48+
if (assoclen < 8)
49+
return -EINVAL;
50+
51+
++<<<<<<< HEAD
52+
+ cryptlen -= authsize;
53+
+
54+
+ if (req->src != dst) {
55+
+ err = crypto_authenc_esn_copy(req, assoclen + cryptlen);
56+
+ if (err)
57+
+ return err;
58+
+ }
59+
+
60+
+ scatterwalk_map_and_copy(ihash, req->src, assoclen + cryptlen,
61+
+ authsize, 0);
62+
+
63+
++=======
64+
++>>>>>>> e02494114ebf (crypto: authencesn - Do not place hiseq at end of dst for out-of-place decryption)
65+
if (!authsize)
66+
goto tail;
67+
68+
* Unmerged path crypto/authencesn.c

0 commit comments

Comments
 (0)