summaryrefslogtreecommitdiff
path: root/net/bpf/test_run.c
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2022-11-21 21:03:39 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-31 15:32:14 +0300
commit21f15d8ffdb46e95d721810c2d7ed2149fff397c (patch)
tree6904a06708b41c9e5985b00f121839e968aa0a66 /net/bpf/test_run.c
parent92f30b33df3d5609f7f613f72238e07aabcb36cd (diff)
downloadlinux-21f15d8ffdb46e95d721810c2d7ed2149fff397c.tar.xz
bpf: Move skb->len == 0 checks into __bpf_redirect
[ Upstream commit 114039b342014680911c35bd6b72624180fd669a ] To avoid potentially breaking existing users. Both mac/no-mac cases have to be amended; mac_header >= network_header is not enough (verified with a new test, see next patch). Fixes: fd1894224407 ("bpf: Don't redirect packets with invalid pkt_len") Signed-off-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/r/20221121180340.1983627-1-sdf@google.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/bpf/test_run.c')
-rw-r--r--net/bpf/test_run.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index fcb3e6c5e03c..6094ef7cffcd 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -980,9 +980,6 @@ static int convert___skb_to_skb(struct sk_buff *skb, struct __sk_buff *__skb)
{
struct qdisc_skb_cb *cb = (struct qdisc_skb_cb *)skb->cb;
- if (!skb->len)
- return -EINVAL;
-
if (!__skb)
return 0;