Thread (5 messages) flat view 5 messages, 3 authors, 2018-07-10

Re: [PATCH bpf] bpf: fix ldx in ld_abs rewrite for large offsets

From: Alexei Starovoitov <hidden>
Date: 2018-07-10 15:19:12

On Tue, Jul 10, 2018 at 12:43:22AM +0200, Daniel Borkmann wrote:
Mark reported that syzkaller triggered a KASAN detected slab-out-of-bounds
bug in ___bpf_prog_run() with a BPF_LD | BPF_ABS word load at offset 0x8001.
After further investigation it became clear that the issue was the
BPF_LDX_MEM() which takes offset as an argument whereas it cannot encode
larger than S16_MAX offsets into it. For this synthetical case we need to
move the full address into tmp register instead and do the LDX without
immediate value.

Fixes: e0cea7ce988c ("bpf: implement ld_abs/ld_ind in native bpf")
Reported-by: syzbot <redacted>
Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Applied, Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help