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:52:32 +0000 (17:52 +0200)
commit479884b4ce16ea6a4cc5a4392f8d778616db9e26
tree997e87e81bacb0eeb4cffd9fb459667c530b1418
parent9a0056276f5f38e188732bd7b6949edca6a80ea1
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