From: Jakub Kicinski Date: Mon, 16 Oct 2017 23:40:56 +0000 (-0700) Subject: bpf: allow access to skb->len from offloads X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=29d1b33a2e0a3288374102b004a15cb278a2303e;p=linux.git bpf: allow access to skb->len from offloads Since we are now doing strict checking of what offloads may access, make sure skb->len is on that list. Signed-off-by: Jakub Kicinski Acked-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: David S. Miller --- diff --git a/net/core/filter.c b/net/core/filter.c index 7373a08fbef73..09e011f20291e 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -3738,6 +3738,8 @@ tc_cls_act_is_valid_access_analyzer(int off, int size, struct bpf_insn_access_aux *info) { switch (off) { + case offsetof(struct sk_buff, len): + return true; case offsetof(struct sk_buff, data): info->reg_type = PTR_TO_PACKET; return true;