Skip to content

Fix bpf_throw() <> global subprogs interaction

Kumar Kartikeya Dwivedi bpf 2 versions – Applied

Status from this message: This series was applied to bpf/bpf.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesApplied 2/2
  2. v12 patches 1 replySuperseded

Changes in v2 from the cover letter

v1: https://lore.kernel.org/bpf/[email protected]

* Reorder might_throw bit to avoid bpf-next conflicts. (Alexei)

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: Check global subprog exception pathsinclude/linux/bpf_verifier.h kernel/bpf/cfg.c kernel/bpf/verifier.c+31 -70 repliesApplied
2/2selftests/bpf: Cover global subprog exception leakstools/testing/selftests/bpf/progs/exceptions_fail.c+22 -00 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH bpf v2 0/2] Fix bpf_throw() <> global subprogs interaction

There is a bug where bpf_throw()'s reachability across global subprogs is missed by the verifier, leading to successful verification when any kernel resource or lock is held across global subprog call boundary.

Fix this by effect summarization like other related side effects and propagate exception reachability into callees.

Changelog:
----------
v1 -> v2
v1: https://lore.kernel.org/bpf/[email protected]

* Reorder might_throw bit to avoid bpf-next conflicts. (Alexei)

Kumar Kartikeya Dwivedi (2):
bpf: Check global subprog exception paths selftests/bpf: Cover global subprog exception leaks

 include/linux/bpf_verifier.h                  |  2 ++
 kernel/bpf/cfg.c                              | 13 ++++++++++-
 kernel/bpf/verifier.c                         | 23 ++++++++++++++-----
 .../selftests/bpf/progs/exceptions_fail.c     | 22 ++++++++++++++++++
 4 files changed, 53 insertions(+), 7 deletions(-)

base-commit: a828abbb897657451d96ad7bf20f1893ac983bb9

Signature · 1 line
2.53.0