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)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 30 Oct 2020 11:57:38 +0000 (12:57 +0100)
commitaf8afcf1fdd5f365f70e2386c2d8c7a1abd853d7
treeb6b087a7f6e10292c2925314e14ecb3d1148a221
parentdceababac29d1c53cbc1f7ddf6f688d2df01da87
wireguard: selftests: check that route_me_harder packets use the right sk

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>
tools/testing/selftests/wireguard/netns.sh
tools/testing/selftests/wireguard/qemu/kernel.config