net: af_key: check encryption module availability consistency
authorThomas Bartschies <thomas.bartschies@cvk.de>
Wed, 18 May 2022 06:32:18 +0000 (08:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jun 2022 06:19:45 +0000 (08:19 +0200)
commit8c73e7c18e093c63bc0dbca2cca81e832f3b9fbc
treeb4c3dab135eecc7bec709bb1e77125b2ec7feb21
parent95302ce6d8a08e88b7562238a8018820631325b6
net: af_key: check encryption module availability consistency

[ Upstream commit 015c44d7bff3f44d569716117becd570c179ca32 ]

Since the recent introduction supporting the SM3 and SM4 hash algos for IPsec, the kernel
produces invalid pfkey acquire messages, when these encryption modules are disabled. This
happens because the availability of the algos wasn't checked in all necessary functions.
This patch adds these checks.

Signed-off-by: Thomas Bartschies <thomas.bartschies@cvk.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/key/af_key.c