]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
xfrm: Validate address prefix lengths in the xfrm selector.
authorSteffen Klassert <steffen.klassert@secunet.com>
Wed, 1 Aug 2018 11:45:11 +0000 (13:45 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:54:34 +0000 (19:54 -0600)
commite5545c7b973287161f8bc3e9fbdd81449e7ffee6
tree53bd47db2734719ae6e3095905bc0d7bba7dd4f0
parented185139d06179c6744324d6cd8c32d6bb794b63
xfrm: Validate address prefix lengths in the xfrm selector.

BugLink: https://bugs.launchpad.net/bugs/1836654
[ Upstream commit 07bf7908950a8b14e81aa1807e3c667eab39287a ]

We don't validate the address prefix lengths in the xfrm
selector we got from userspace. This can lead to undefined
behaviour in the address matching functions if the prefix
is too big for the given address family. Fix this by checking
the prefixes and refuse SA/policy insertation when a prefix
is invalid.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Air Icy <icytxw@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
net/xfrm/xfrm_user.c