bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf 0/2] Limit tail calls to 33 in all JIT compilers
@ 2019-12-09 18:51 Paul Chaignon
  2019-12-09 18:52 ` [PATCH bpf 1/2] bpf, riscv: limit to 33 tail calls Paul Chaignon
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Paul Chaignon @ 2019-12-09 18:51 UTC (permalink / raw)
  To: Paul Burton, Björn Töpel
  Cc: Mahshid Khezri, paul.chaignon, bpf, netdev, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	Andrii Nakryiko

The BPF interpreter and all JIT compilers, except RISC-V's and MIPS',
enforce a 33-tail calls limit at runtime.  Because of this discrepancy, a
BPF program can have a different behavior and output depending on whether
it is interpreted or JIT compiled, or depending on the underlying
architecture.

This patchset changes the RISC-V and MIPS JIT compilers to limit tail
calls to 33 instead of 32.  I have checked other BPF JIT compilers for the
same discrepancy.

Paul Chaignon (2):
  bpf, riscv: limit to 33 tail calls
  bpf, mips: limit to 33 tail calls

 arch/mips/net/ebpf_jit.c      | 9 +++++----
 arch/riscv/net/bpf_jit_comp.c | 4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-12-18 10:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 18:51 [PATCH bpf 0/2] Limit tail calls to 33 in all JIT compilers Paul Chaignon
2019-12-09 18:52 ` [PATCH bpf 1/2] bpf, riscv: limit to 33 tail calls Paul Chaignon
2019-12-09 19:57   ` Björn Töpel
2019-12-10  6:31     ` Björn Töpel
2019-12-10  9:36     ` Paul Chaignon
2019-12-09 18:52 ` [PATCH bpf 2/2] bpf, mips: " Paul Chaignon
2019-12-10 23:23   ` Paul Burton
2019-12-12 16:19     ` Daniel Borkmann
2019-12-18  9:32     ` Alexander Lobakin
2019-12-18  9:58       ` Paul Chaignon
2019-12-18 10:02         ` Alexander Lobakin
2019-12-10 18:19 ` [PATCH bpf 0/2] Limit tail calls to 33 in all JIT compilers Martin Lau
2019-12-11 13:00 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).