]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: af_key: fix sadb_x_filter validation
authorLin Ma <linma@zju.edu.cn>
Tue, 27 Jun 2023 03:39:54 +0000 (11:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Aug 2023 15:32:42 +0000 (17:32 +0200)
commit66e1cd1b06c0158044dd7813b91c156ed5c2f80e
tree87303ff949c646301997babd24aa20e11f37ce92
parent5713c7ca31f563a493281c25cbdbd3f4ef53a9e9
net: af_key: fix sadb_x_filter validation

[ Upstream commit 75065a8929069bc93181848818e23f147a73f83a ]

When running xfrm_state_walk_init(), the xfrm_address_filter being used
is okay to have a splen/dplen that equals to sizeof(xfrm_address_t)<<3.
This commit replaces >= to > to make sure the boundary checking is
correct.

Fixes: 37bd22420f85 ("af_key: pfkey_dump needs parameter validation")
Signed-off-by: Lin Ma <linma@zju.edu.cn>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/key/af_key.c