Re: [PATCH net-next] bpf: Preserve const register type on const OR alu ops

2016-12-05 Thread David Miller
From: Alexei Starovoitov Date: Sat, 3 Dec 2016 12:31:33 -0800 > From: Gianluca Borello > > Occasionally, clang (e.g. version 3.8.1) translates a sum between two > constant operands using a BPF_OR instead of a BPF_ADD. The verifier is > currently not handling this scenario, and the destination r

Re: [PATCH net-next] bpf: Preserve const register type on const OR alu ops

2016-12-03 Thread Daniel Borkmann
On 12/03/2016 09:31 PM, Alexei Starovoitov wrote: From: Gianluca Borello Occasionally, clang (e.g. version 3.8.1) translates a sum between two constant operands using a BPF_OR instead of a BPF_ADD. The verifier is currently not handling this scenario, and the destination register type becomes U

[PATCH net-next] bpf: Preserve const register type on const OR alu ops

2016-12-03 Thread Alexei Starovoitov
From: Gianluca Borello Occasionally, clang (e.g. version 3.8.1) translates a sum between two constant operands using a BPF_OR instead of a BPF_ADD. The verifier is currently not handling this scenario, and the destination register type becomes UNKNOWN_VALUE even if it's still storing a constant.