diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-01-22 19:39:25 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-01-22 19:39:25 -0800 |
| commit | c072629f05d7bca1148ab17690d7922a31423984 (patch) | |
| tree | c16b712e42590ef85aa0707f7c37255fecf3389b | |
| parent | 614da1d3d4cdbd6e41aea06bc97ec15aacff6daf (diff) | |
| parent | 2397e9264676be7794f8f7f1e9763d90bd3c7335 (diff) | |
| download | linux-master.tar.gz | |
Pull crypto fix from Herbert Xu:
- Add assoclen check in authencesn
* tag 'v6.19-p4' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: authencesn - reject too-short AAD (assoclen<8) to match ESP/ESN spec
| -rw-r--r-- | crypto/authencesn.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/authencesn.c b/crypto/authencesn.c index d1bf0fda3f2ef6..542a978663b9e7 100644 --- a/crypto/authencesn.c +++ b/crypto/authencesn.c @@ -169,6 +169,9 @@ static int crypto_authenc_esn_encrypt(struct aead_request *req) struct scatterlist *src, *dst; int err; + if (assoclen < 8) + return -EINVAL; + sg_init_table(areq_ctx->src, 2); src = scatterwalk_ffwd(areq_ctx->src, req->src, assoclen); dst = src; @@ -256,6 +259,9 @@ static int crypto_authenc_esn_decrypt(struct aead_request *req) u32 tmp[2]; int err; + if (assoclen < 8) + return -EINVAL; + cryptlen -= authsize; if (req->src != dst) |
