Re: [PATCH net-next] bpf: Fix out-of-bound access on interpreters[]

2017-06-29 Thread David Miller
From: Martin KaFai Lau 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: b

[PATCH net-next] bpf: Fix out-of-bound access on interpreters[]

2017-06-28 Thread Martin KaFai Lau
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. [ 22.318680] == [