]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wireguard: selftests: check that route_me_harder packets use the right sk
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 29 Oct 2020 02:56:05 +0000 (03:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:12 +0000 (19:22 +0100)
commitc9ed6f0c3d8e8277d2cbf0ba70875abcf80a881b
tree4c159dfddc074e13dbe4d04bf0d1921e0fdaf30a
parent5ad605509f5369fedda434d5bcecb7aedf5563ee
wireguard: selftests: check that route_me_harder packets use the right sk

[ Upstream commit af8afcf1fdd5f365f70e2386c2d8c7a1abd853d7 ]

If netfilter changes the packet mark, the packet is rerouted. The
ip_route_me_harder family of functions fails to use the right sk, opting
to instead use skb->sk, resulting in a routing loop when used with
tunnels. With the next change fixing this issue in netfilter, test for
the relevant condition inside our test suite, since wireguard was where
the bug was discovered.

Reported-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/wireguard/netns.sh
tools/testing/selftests/wireguard/qemu/kernel.config