Re: [PATCH net-next] bpf: Fix out-of-bound access on interpreters[]
From: David Miller <davem@davemloft.net>
Date: 2017-06-29 19:37:34
From: David Miller <davem@davemloft.net>
Date: 2017-06-29 19:37:34
From: Martin KaFai Lau <redacted> Date: Wed, 28 Jun 2017 10:41:24 -0700
The index is off-by-one when fp->aux->stack_depth has already been rounded up to 32. In particular, if stack_depth is 512, the index will be 16. The fix is to round_up and then takes -1 instead of round_down.
...
Fixes: b870aa901f4b ("bpf: use different interpreter depending on required stack size")
Signed-off-by: Martin KaFai Lau <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>Applied, thanks Martin.