Skip to content

bpf: Fix interpreter-unsupported insns

Leon Hwang bpf lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call()include/linux/bpf.h kernel/bpf/core.c kernel/bpf/verifier.c+8 -200 replies
2/4bpf: Reject programs with inlined helpers if JIT is not availablekernel/bpf/verifier.c+3 -10 replies
3/4bpf: Disallow interpreter fallback for arena-related insnskernel/bpf/verifier.c+1 -00 replies
4/4bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insninclude/linux/bpf.h kernel/bpf/verifier.c+17 -00 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchLeon HwangGuillaume Laporte
SeriesT-b
1/4A-b
2/4A-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH linux-6.12.y 0/4] bpf: Fix interpreter-unsupported insns

Request from Guillaume and Vincent [1][2], backport the following commits to linux-6.12.y with editing the commits manually.

9a6df65d5c6a ("bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call()") f1c27922576e ("bpf: Reject programs with inlined helpers if JIT is not available") 34746b5a84ec ("bpf: Disallow interpreter fallback for arena-related insns") 7a0855e73757 ("bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn")

As there was a big code refactoring in linux 7.1, the changes in the new file kernel/bpf/fixups.c will be backported to the positions in kernel/bpf/verifier.c.

Patch 1 introduces a new bit 'jit_required' in struct bpf_prog. The other patches set 'jit_required' to fix the issues.

Links:
[1] https://lore.kernel.org/bpf/BESPR02MB12296D62B1B3F33BA21C4F24AF1432@BESPR02MB12296.eurprd02.prod.outlook.com/
[2] https://lore.kernel.org/bpf/MR1P264MB331494502C9D13D8A9EAFB99B7E82@MR1P264MB3314.FRAP264.PROD.OUTLOOK.COM/

Leon Hwang (2):
bpf: Disallow interpreter fallback for arena-related insns
bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn

Tiezhu Yang (2):
bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call()
bpf: Reject programs with inlined helpers if JIT is not available

 include/linux/bpf.h   | 22 +++++++++++++++-------
 kernel/bpf/core.c     |  7 ++-----
 kernel/bpf/verifier.c | 21 ++++++++++++---------
 3 files changed, 29 insertions(+), 21 deletions(-)

--
2.55.0