-
- Downloads
bpf: allow programs to write to certain skb fields
allow programs read/write skb->mark, tc_index fields and ((struct qdisc_skb_cb *)cb)->data. mark and tc_index are generically useful in TC. cb[0]-cb[4] are primarily used to pass arguments from one program to another called via bpf_tail_call() which can be seen in sockex3_kern.c example. All fields of 'struct __sk_buff' are readable to socket and tc_cls_act progs. mark, tc_index are writeable from tc_cls_act only. cb[0]-cb[4] are writeable by both sockets and tc_cls_act. Add verifier tests and improve sample code. Signed-off-by:Alexei Starovoitov <ast@plumgrid.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/linux/bpf.h 2 additions, 1 deletioninclude/linux/bpf.h
- include/uapi/linux/bpf.h 2 additions, 0 deletionsinclude/uapi/linux/bpf.h
- kernel/bpf/verifier.c 28 additions, 9 deletionskernel/bpf/verifier.c
- net/core/filter.c 82 additions, 12 deletionsnet/core/filter.c
- samples/bpf/sockex3_kern.c 11 additions, 24 deletionssamples/bpf/sockex3_kern.c
- samples/bpf/test_verifier.c 82 additions, 2 deletionssamples/bpf/test_verifier.c
Loading
Please register or sign in to comment