selftests/bpf: Make sure zero-len skbs aren't redirectable
authorStanislav Fomichev <sdf@google.com>
Mon, 21 Nov 2022 18:03:40 +0000 (10:03 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:15 +0000 (13:32 +0100)
commit4074774f55d4a1b35f2e89e450ab33a793212249
tree9c80c885b4f2b783facd4dca5a5401527df553dc
parentcbd17cb4df07040fa3734b0a23eb88c871d48ed0
selftests/bpf: Make sure zero-len skbs aren't redirectable

[ Upstream commit 68f8e3d4b916531ea3bb8b83e35138cf78f2fce5 ]

LWT_XMIT to test L3 case, TC to test L2 case.

v2:
- s/veth_ifindex/ipip_ifindex/ in two places (Martin)
- add comment about which condition triggers the rejection (Martin)

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/20221121180340.1983627-2-sdf@google.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Stable-dep-of: 8ac88eece800 ("selftests/bpf: Mount debugfs in setns_by_fd")
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/prog_tests/empty_skb.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/empty_skb.c [new file with mode: 0644]