Skip to content

Commit 29d1b33

Browse files
Jakub Kicinskidavem330
authored andcommitted
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 <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4f9218a commit 29d1b33

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/core/filter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3738,6 +3738,8 @@ tc_cls_act_is_valid_access_analyzer(int off, int size,
37383738
struct bpf_insn_access_aux *info)
37393739
{
37403740
switch (off) {
3741+
case offsetof(struct sk_buff, len):
3742+
return true;
37413743
case offsetof(struct sk_buff, data):
37423744
info->reg_type = PTR_TO_PACKET;
37433745
return true;

0 commit comments

Comments
 (0)