Thread (2 messages) 2 messages, 2 authors, 2018-01-16

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

From: Alexei Starovoitov <hidden>
Date: 2018-01-16 23:13:05

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_MEM- or
BPF_STX_MEM-type operations, thus reject anything other than
that so that assumptions in the rewriter properly hold. Add
test cases as well for BPF selftests.

Fixes: d691f9e8d440 ("bpf: allow programs to write to certain skb fields")
Reported-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Applied, thank you Daniel.

all bugs are eventually shallow.
For this one we even had two broken testcases. Ouch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help