Re: [PATCH bpf-next v2 3/9] bpf/verifier: refine retval R0 state for bpf_get_stack helper

2018-04-19 Thread Yonghong Song
On 4/18/18 9:33 PM, Alexei Starovoitov wrote: On Wed, Apr 18, 2018 at 09:54:38AM -0700, Yonghong Song wrote: The special property of return values for helpers bpf_get_stack and bpf_probe_read_str are captured in verifier. Both helpers return a negative error code or a length, which is equal

Re: [PATCH bpf-next v2 3/9] bpf/verifier: refine retval R0 state for bpf_get_stack helper

2018-04-18 Thread Alexei Starovoitov
On Wed, Apr 18, 2018 at 09:54:38AM -0700, Yonghong Song wrote: > The special property of return values for helpers bpf_get_stack > and bpf_probe_read_str are captured in verifier. > Both helpers return a negative error code or > a length, which is equal to or smaller than the buffer > size

[PATCH bpf-next v2 3/9] bpf/verifier: refine retval R0 state for bpf_get_stack helper

2018-04-18 Thread Yonghong Song
The special property of return values for helpers bpf_get_stack and bpf_probe_read_str are captured in verifier. Both helpers return a negative error code or a length, which is equal to or smaller than the buffer size argument. This additional information in the verifier can avoid the condition