Re: [PATCH v3 bpf] bpf: prevent out-of-bounds speculation

2018-01-08 Thread Daniel Borkmann
On 01/08/2018 02:33 AM, Alexei Starovoitov wrote: > Under speculation, CPUs may mis-predict branches in bounds checks. Thus, > memory accesses under a bounds check may be speculated even if the > bounds check fails, providing a primitive for building a side channel. > > To avoid leaking kernel dat

[PATCH v3 bpf] bpf: prevent out-of-bounds speculation

2018-01-07 Thread Alexei Starovoitov
Under speculation, CPUs may mis-predict branches in bounds checks. Thus, memory accesses under a bounds check may be speculated even if the bounds check fails, providing a primitive for building a side channel. To avoid leaking kernel data round up array-based maps and mask the index after bounds