diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2026-04-12 13:32:21 +0800 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2026-04-12 13:38:19 +0800 |
| commit | 3d14bd48e3a77091cbce637a12c2ae31b4a1687c (patch) | |
| tree | 071d9381c94e2d2572b5439e626b28d1fa9ecf1a /crypto | |
| parent | d702c3408213bb12bd570bb97204d8340d141c51 (diff) | |
| download | lwn-3d14bd48e3a77091cbce637a12c2ae31b4a1687c.tar.gz lwn-3d14bd48e3a77091cbce637a12c2ae31b4a1687c.zip | |
crypto: algif_aead - Fix minimum RX size check for decryption
The check for the minimum receive buffer size did not take the
tag size into account during decryption. Fix this by adding the
required extra length.
Reported-by: syzbot+aa11561819dc42ebbc7c@syzkaller.appspotmail.com
Reported-by: Daniel Pouzzner <douzzer@mega.nu>
Fixes: d887c52d6ae4 ("crypto: algif_aead - overhaul memory management")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
| -rw-r--r-- | crypto/algif_aead.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c index dda15bb05e89..f8bd45f7dc83 100644 --- a/crypto/algif_aead.c +++ b/crypto/algif_aead.c @@ -144,7 +144,7 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg, if (usedpages < outlen) { size_t less = outlen - usedpages; - if (used < less) { + if (used < less + (ctx->enc ? 0 : as)) { err = -EINVAL; goto free; } |
