Skip to content

Commit

Permalink
bpf: allow access to skb->len from offloads
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Oct 18, 2017
1 parent 4f9218a commit 29d1b33
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 29d1b33

Please sign in to comment.