Re: [PATCH bpf] bpf: fix off-by-one error in adjust_subprog_starts

From: Alexei Starovoitov
Date: Sat Nov 17 2018 - 00:15:39 EST


On Fri, Nov 16, 2018 at 12:00:07PM +0000, Edward Cree wrote:
> When patching in a new sequence for the first insn of a subprog, the start
> of that subprog does not change (it's the first insn of the sequence), so
> adjust_subprog_starts should check start <= off (rather than < off).
> Also added a test to test_verifier.c (it's essentially the syz reproducer).
>
> Fixes: cc8b0b92a169 ("bpf: introduce function calls (function boundaries)")
> Reported-by: syzbot+4fc427c7af994b0948be@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Edward Cree <ecree@xxxxxxxxxxxxxx>

thanks for quick analysis and fix.
Applied, Thanks