Re: [PATCH bpf-next 1/2] bpf: permit map_ptr arithmetic with opcode add and offset 0

2020-09-07 Thread Daniel Borkmann
On 9/5/20 2:10 AM, Alexei Starovoitov wrote: On Fri, Sep 4, 2020 at 5:08 PM Andrii Nakryiko wrote: On Fri, Sep 4, 2020 at 4:20 PM Yonghong Song wrote: [...] for scalar constant, reg->var_off.mask should be 0. so we will have reg->smin_value = reg->smax_value = (s64)reg->var_off.value. The s

Re: [PATCH bpf-next 1/2] bpf: permit map_ptr arithmetic with opcode add and offset 0

2020-09-04 Thread Alexei Starovoitov
On Fri, Sep 4, 2020 at 5:08 PM Andrii Nakryiko wrote: > > On Fri, Sep 4, 2020 at 4:20 PM Yonghong Song wrote: > > > > > > > > On 9/4/20 1:30 PM, Andrii Nakryiko wrote: > > > On Fri, Sep 4, 2020 at 12:49 PM Yonghong Song wrote: > > >> > > >> Commit 41c48f3a98231 ("bpf: Support access > > >> to bp

Re: [PATCH bpf-next 1/2] bpf: permit map_ptr arithmetic with opcode add and offset 0

2020-09-04 Thread Andrii Nakryiko
On Fri, Sep 4, 2020 at 4:20 PM Yonghong Song wrote: > > > > On 9/4/20 1:30 PM, Andrii Nakryiko wrote: > > On Fri, Sep 4, 2020 at 12:49 PM Yonghong Song wrote: > >> > >> Commit 41c48f3a98231 ("bpf: Support access > >> to bpf map fields") added support to access map fields > >> with CORE support. F

Re: [PATCH bpf-next 1/2] bpf: permit map_ptr arithmetic with opcode add and offset 0

2020-09-04 Thread Yonghong Song
On 9/4/20 1:30 PM, Andrii Nakryiko wrote: On Fri, Sep 4, 2020 at 12:49 PM Yonghong Song wrote: Commit 41c48f3a98231 ("bpf: Support access to bpf map fields") added support to access map fields with CORE support. For example, struct bpf_map { __u32 max_entr

Re: [PATCH bpf-next 1/2] bpf: permit map_ptr arithmetic with opcode add and offset 0

2020-09-04 Thread Andrii Nakryiko
On Fri, Sep 4, 2020 at 12:49 PM Yonghong Song wrote: > > Commit 41c48f3a98231 ("bpf: Support access > to bpf map fields") added support to access map fields > with CORE support. For example, > > struct bpf_map { > __u32 max_entries; > } __attribute__((pr

[PATCH bpf-next 1/2] bpf: permit map_ptr arithmetic with opcode add and offset 0

2020-09-04 Thread Yonghong Song
Commit 41c48f3a98231 ("bpf: Support access to bpf map fields") added support to access map fields with CORE support. For example, struct bpf_map { __u32 max_entries; } __attribute__((preserve_access_index)); struct bpf_array {