Skip to content

Commit 7d0da91

Browse files
committed
crypto: algif_hash - fix double free in hash_accept
jira VULN-72165 cve CVE-2025-38079 commit-author Ivan Pravdin <ipravdin.official@gmail.com> commit b2df03e If accept(2) is called on socket type algif_hash with MSG_MORE flag set and crypto_ahash_import fails, sk2 is freed. However, it is also freed in af_alg_release, leading to slab-use-after-free error. Fixes: fe869cd ("crypto: algif_hash - User-space interface for hash operations") Cc: <stable@vger.kernel.org> Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit b2df03e) Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
1 parent 6577203 commit 7d0da91

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

crypto/algif_hash.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,6 @@ static int hash_accept(struct socket *sock, struct socket *newsock, int flags)
284284
return err;
285285

286286
err = crypto_ahash_import(&ctx2->req, state);
287-
if (err) {
288-
sock_orphan(sk2);
289-
sock_put(sk2);
290-
}
291287

292288
return err;
293289
}

0 commit comments

Comments
 (0)