Patch "bpf: Fix off-by-one in tail call count limiting" has been added to the 5.14-stable tree
Daniel Borkmann
maintainerHi Sasha,
Quoted 14 lines · Sasha Levin
This is a note to let you know that I've just added the patch titled
bpf: Fix off-by-one in tail call count limiting
to the 5.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
bpf-fix-off-by-one-in-tail-call-count-limiting.patch
and it can be found in the queue-5.14 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 7 lines
commit
0af0fa0371eb376731a350bfdd8687e7ec206bb9Author: Johan Almbladh <[email protected]> Date: Wed Jul 28 18:47:41 2021 +0200bpf: Fix off-by-one in tail call count limiting
[ Upstream commit
b61a28cf11d61f512172e673b8f8c4a6c789b425]
Please either drop this commit from stable queues, or also queue its revert as well (in case you don't have a filter in place, and there's a chance this could get re-queued again in future by accident):
Quoted 16 lines
Before, the interpreter allowed up to
MAX_TAIL_CALL_CNT+ 1 tail calls. Now preciselyMAX_TAIL_CALL_CNTis allowed, which is in line with the behavior of the x86 JITs.Signed-off-by Johan Almbladh <[email protected]>Signed-off-by Andrii Nakryiko <[email protected]>Acked-by Yonghong Song <[email protected]>Signed-off-by Sasha Levin <[email protected]>kernel/bpf/core.c +0
-0
kernel/bpf/core.c static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn) · line 1570
Quoted 8 lines
kernel/bpf/core.c +1
-1@@ -1564,7 +1564,7 @@ static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn)if (unlikely (index >= array->map.max_entries)) goto out; -if (unlikely (tail_call_cnt >MAX_TAIL_CALL_CNT )) +if (unlikely (tail_call_cnt >=MAX_TAIL_CALL_CNT )) goto out; tail_call_cnt++;
Thanks,
Daniel