Re: [PATCH bpf-next v1 1/8] bpf: Introduce pseudo_btf_id

2020-08-24 Thread Yonghong Song
On 8/24/20 5:05 PM, Hao Luo wrote: Yonghong, An update on this thread. I successfully reproduced this issue on a 8.2.0 gcc compiler, It looks like gcc 4.9 did not have this issue. I was also using clang which did not show this bug. It seems having a DW_AT_specification that refers to

Re: [PATCH bpf-next v1 1/8] bpf: Introduce pseudo_btf_id

2020-08-24 Thread Hao Luo
Yonghong, An update on this thread. I successfully reproduced this issue on a 8.2.0 gcc compiler, It looks like gcc 4.9 did not have this issue. I was also using clang which did not show this bug. It seems having a DW_AT_specification that refers to another DW_TAG_variable isn't handled in

Re: [PATCH bpf-next v1 1/8] bpf: Introduce pseudo_btf_id

2020-08-20 Thread Hao Luo
On Thu, Aug 20, 2020 at 2:53 PM Alexei Starovoitov wrote: > > Why did you choose to do it during main do_check() walk instead of this > pre-pass ? > check_ld_imm() can be called multiple times for the same insn, > so it's faster and less surprising to do it during >

Re: [PATCH bpf-next v1 1/8] bpf: Introduce pseudo_btf_id

2020-08-20 Thread Alexei Starovoitov
On Wed, Aug 19, 2020 at 03:40:23PM -0700, Hao Luo wrote: > + > /* verify BPF_LD_IMM64 instruction */ > static int check_ld_imm(struct bpf_verifier_env *env, struct bpf_insn *insn) > { > @@ -7234,6 +7296,9 @@ static int check_ld_imm(struct bpf_verifier_env *env, > struct bpf_insn *insn) >

Re: [PATCH bpf-next v1 1/8] bpf: Introduce pseudo_btf_id

2020-08-20 Thread Hao Luo
Yonghong, Thank you for taking a look. Explicitly cc'ing Arnaldo to see if he has any immediate insights. In the meantime, I'll dedicate time to investigate this issue you found. Thanks, Hao On Thu, Aug 20, 2020 at 8:23 AM Yonghong Song wrote: > > > > On 8/19/20 3:40 PM, Hao Luo wrote: > >

Re: [PATCH bpf-next v1 1/8] bpf: Introduce pseudo_btf_id

2020-08-20 Thread Yonghong Song
On 8/19/20 3:40 PM, Hao Luo wrote: Pseudo_btf_id is a type of ld_imm insn that associates a btf_id to a ksym so that further dereferences on the ksym can use the BTF info to validate accesses. Internally, when seeing a pseudo_btf_id ld insn, the verifier reads the btf_id stored in the

Re: [PATCH bpf-next v1 1/8] bpf: Introduce pseudo_btf_id

2020-08-20 Thread Yonghong Song
On 8/19/20 3:40 PM, Hao Luo wrote: Pseudo_btf_id is a type of ld_imm insn that associates a btf_id to a ksym so that further dereferences on the ksym can use the BTF info to validate accesses. Internally, when seeing a pseudo_btf_id ld insn, the verifier reads the btf_id stored in the

[PATCH bpf-next v1 1/8] bpf: Introduce pseudo_btf_id

2020-08-19 Thread Hao Luo
Pseudo_btf_id is a type of ld_imm insn that associates a btf_id to a ksym so that further dereferences on the ksym can use the BTF info to validate accesses. Internally, when seeing a pseudo_btf_id ld insn, the verifier reads the btf_id stored in the insn[0]'s imm field and marks the dst_reg as