bpf: allow access to skb->len from offloads
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 16 Oct 2017 23:40:56 +0000 (16:40 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Oct 2017 13:17:11 +0000 (14:17 +0100)
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 <jakub.kicinski@netronome.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/filter.c

index 7373a08fbef73e0bfd8a9da0a8fc30066d8366f8..09e011f20291e48d4425434276032ed8b8457348 100644 (file)
@@ -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;