Re: [PATCH bpf-next 04/11] bpf: Add PTR_TO_SOCKET verifier type

2018-09-13 Thread Joe Stringer
On Wed, 12 Sep 2018 at 15:50, Alexei Starovoitov wrote: > > On Tue, Sep 11, 2018 at 05:36:33PM -0700, Joe Stringer wrote: > > ... > > +static bool reg_type_mismatch(enum bpf_reg_type src, enum bpf_reg_type > > prev) > > +{ > > + return src != prev && (!reg_type_mismatch_ok(src) || > > +

Re: [PATCH bpf-next 04/11] bpf: Add PTR_TO_SOCKET verifier type

2018-09-12 Thread Alexei Starovoitov
On Tue, Sep 11, 2018 at 05:36:33PM -0700, Joe Stringer wrote: > Teach the verifier a little bit about a new type of pointer, a > PTR_TO_SOCKET. This pointer type is accessed from BPF through the > 'struct bpf_sock' structure. > > Signed-off-by: Joe Stringer > --- > include/linux/bpf.h

[PATCH bpf-next 04/11] bpf: Add PTR_TO_SOCKET verifier type

2018-09-11 Thread Joe Stringer
Teach the verifier a little bit about a new type of pointer, a PTR_TO_SOCKET. This pointer type is accessed from BPF through the 'struct bpf_sock' structure. Signed-off-by: Joe Stringer --- include/linux/bpf.h | 17 + include/linux/bpf_verifier.h | 2 + kernel/bpf/verifier.c