summaryrefslogtreecommitdiff
path: root/net/bpf
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2022-11-21 21:03:39 +0300
committerMartin KaFai Lau <martin.lau@kernel.org>2022-11-21 23:47:04 +0300
commit114039b342014680911c35bd6b72624180fd669a (patch)
treed1daa22b3d367f3837bf0c2a939b439b61723978 /net/bpf
parent8589e92675aa4727bede3f9230709624619844f3 (diff)
downloadlinux-114039b342014680911c35bd6b72624180fd669a.tar.xz
bpf: Move skb->len == 0 checks into __bpf_redirect
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>
Diffstat (limited to 'net/bpf')
-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 13d578ce2a09..6fba440efc40 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -979,9 +979,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;