[PATCH bpf-next 0/4] BPF control flow graph and precision backtrack fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A few small-ish fixes to BPF verifier's CFG logic around handling and
reporting ldimm64 instructions, and also too eagerly reporting back edges.
Patch #1 was previously submitted separately ([0]), and so this patch set
supersedes that patch.

Fixing above CFG issues uncovered one interesting edge case in precision
backtracking logic, which patch #2 fixes as well. See the patch for details.

All of these fixes seem to cover quite obscure corner cases that don't come up
often in practice. And they all are applicable only to privileged BPF mode.
So targeting bpf-next seems appropriate. Also note that [1] is also touching
get_prev_insn_idx() function, so would conflict if they land in two different
trees.

  [0] https://patchwork.kernel.org/project/netdevbpf/patch/20231101205626.119243-1-andrii@xxxxxxxxxx/
  [1] https://patchwork.kernel.org/project/netdevbpf/list/?series=797781&state=*

Andrii Nakryiko (4):
  bpf: handle ldimm64 properly in check_cfg()
  bpf: fix precision backtracking instruction iteration
  bpf: fix control-flow graph checking in privileged mode
  selftests/bpf: add more test cases for check_cfg()

 include/linux/bpf.h                           |  8 +-
 kernel/bpf/verifier.c                         | 85 ++++++++++++-------
 .../selftests/bpf/progs/verifier_cfg.c        | 66 +++++++++++++-
 .../selftests/bpf/progs/verifier_loops1.c     |  9 +-
 .../testing/selftests/bpf/verifier/ld_imm64.c |  8 +-
 5 files changed, 136 insertions(+), 40 deletions(-)

-- 
2.34.1






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux