Skip to content

Commit 3d14bd4

Browse files
committed
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: [email protected] Reported-by: Daniel Pouzzner <[email protected]> Fixes: d887c52 ("crypto: algif_aead - overhaul memory management") Signed-off-by: Herbert Xu <[email protected]>
1 parent d702c34 commit 3d14bd4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

crypto/algif_aead.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,
144144
if (usedpages < outlen) {
145145
size_t less = outlen - usedpages;
146146

147-
if (used < less) {
147+
if (used < less + (ctx->enc ? 0 : as)) {
148148
err = -EINVAL;
149149
goto free;
150150
}

0 commit comments

Comments
 (0)