projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cdd0a8
)
bpf: Fix off-by-one in tail call count limiting
author
Johan Almbladh
<johan.almbladh@anyfinetworks.com>
Wed, 28 Jul 2021 16:47:41 +0000
(18:47 +0200)
committer
Andrii Nakryiko
<andrii@kernel.org>
Mon, 2 Aug 2021 22:05:43 +0000
(15:05 -0700)
Before, the interpreter allowed up to MAX_TAIL_CALL_CNT + 1 tail calls.
Now precisely MAX_TAIL_CALL_CNT is allowed, which is in line with the
behavior of the x86 JITs.
Signed-off-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link:
https://lore.kernel.org/bpf/20210728164741.350370-1-johan.almbladh@anyfinetworks.com
kernel/bpf/core.c
patch
|
blob
|
history
diff --git
a/kernel/bpf/core.c
b/kernel/bpf/core.c
index b1a5fc04492bd0febe0b57016a69d8875941bddc..fe807b203a6fdea5e7b9430ff1c4d400afa703e2 100644
(file)
--- a/
kernel/bpf/core.c
+++ b/
kernel/bpf/core.c
@@
-1562,7
+1562,7
@@
select_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++;