Re: [PATCH v2 bpf-next] bpf: relax verifier restriction on BPF_MOV | BPF_ALU

2018-12-10 Thread Alexei Starovoitov
On Mon, Dec 10, 2018 at 09:45:30AM +, Jiong Wang wrote: > > > return -EACCES; > > > + } else if (src_reg->type == SCALAR_VALUE) { > > > + *dst_reg = *src_reg; > > > +

Re: [PATCH v2 bpf-next] bpf: relax verifier restriction on BPF_MOV | BPF_ALU

2018-12-10 Thread Jiong Wang
On 09/12/2018 22:17, Alexei Starovoitov wrote: On Fri, Dec 07, 2018 at 12:16:18PM -0500, Jiong Wang wrote: Currently, the destination register is marked as unknown for 32-bit sub-register move (BPF_MOV | BPF_ALU) whenever the source register type is SCALAR_VALUE. This is too conservative that s

Re: [PATCH v2 bpf-next] bpf: relax verifier restriction on BPF_MOV | BPF_ALU

2018-12-09 Thread Alexei Starovoitov
On Fri, Dec 07, 2018 at 12:16:18PM -0500, Jiong Wang wrote: > Currently, the destination register is marked as unknown for 32-bit > sub-register move (BPF_MOV | BPF_ALU) whenever the source register type is > SCALAR_VALUE. > > This is too conservative that some valid cases will be rejected. > Espe

[PATCH v2 bpf-next] bpf: relax verifier restriction on BPF_MOV | BPF_ALU

2018-12-07 Thread Jiong Wang
Currently, the destination register is marked as unknown for 32-bit sub-register move (BPF_MOV | BPF_ALU) whenever the source register type is SCALAR_VALUE. This is too conservative that some valid cases will be rejected. Especially, this may turn a constant scalar value into unknown value that co