Re: [PATCH bpf] bpf: reject stores into ctx via st and xadd

2018-01-16 Thread Alexei Starovoitov
On Tue, Jan 16, 2018 at 11:30:10PM +0100, Daniel Borkmann wrote: > Alexei found that verifier does not reject stores into context > via BPF_ST instead of BPF_STX. And while looking at it, we > also should not allow XADD variant of BPF_STX. > > The context rewriter is only assuming either BPF_LDX_M

[PATCH bpf] bpf: reject stores into ctx via st and xadd

2018-01-16 Thread Daniel Borkmann
Alexei found that verifier does not reject stores into context via BPF_ST instead of BPF_STX. And while looking at it, we also should not allow XADD variant of BPF_STX. The context rewriter is only assuming either BPF_LDX_MEM- or BPF_STX_MEM-type operations, thus reject anything other than that so