]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: algif_hash - fix double free in hash_accept
authorIvan Pravdin <ipravdin.official@gmail.com>
Sun, 18 May 2025 22:41:02 +0000 (18:41 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:40:20 +0000 (14:40 +0200)
commitf0f3d09f53534ea385d55ced408f2b67059b16e4
tree75ac5340e449ba376db53637861d25a0a3e9ec9e
parent3cb003b959d7e5a1abaddf5434fb8a5a69b916a2
crypto: algif_hash - fix double free in hash_accept

commit b2df03ed4052e97126267e8c13ad4204ea6ba9b6 upstream.

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: fe869cdb89c9 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/algif_hash.c