Re: [PATCH bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB

2018-10-17 Thread Song Liu
> On Oct 17, 2018, at 12:02 PM, Alexei Starovoitov wrote: > > On 10/17/18 10:26 AM, Alexei Starovoitov wrote: >> On Tue, Oct 16, 2018 at 10:56:05PM -0700, Song Liu wrote: >>> BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the >>> skb. This patch enables direct access of

Re: [PATCH bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB

2018-10-17 Thread Alexei Starovoitov
On 10/17/18 10:26 AM, Alexei Starovoitov wrote: > On Tue, Oct 16, 2018 at 10:56:05PM -0700, Song Liu wrote: >> BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the >> skb. This patch enables direct access of skb for these programs. > > The lack of direct packet access in

Re: [PATCH bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB

2018-10-17 Thread Alexei Starovoitov
On Tue, Oct 16, 2018 at 10:56:05PM -0700, Song Liu wrote: > BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the > skb. This patch enables direct access of skb for these programs. The lack of direct packet access in CGROUP_SKB progs was an unpleasant surprise to me, so thank you

[PATCH bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB

2018-10-16 Thread Song Liu
BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the skb. This patch enables direct access of skb for these programs. In __cgroup_bpf_run_filter_skb(), bpf_compute_data_pointers() is called to compute proper data_end for the BPF program. Signed-off-by: Song Liu ---