Skip to content

Two more fixes for check_max_stack_depth

Kumar Kartikeya Dwivedi bpf 2 versions – Applied

Status from this message: Applied. Thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied
  2. v13 patches 2 repliesSuperseded

Changes in v2 from the cover letter

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

* Fix commit message for patch 2 (Alexei)

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3bpf: Fix subprog idx logic in check_max_stack_depthkernel/bpf/verifier.c+6 -50 replies
2/3bpf: Repeat check_max_stack_depth for async callbackskernel/bpf/verifier.c+19 -21 reply
3/3selftests/bpf: Add more tests for check_max_stack_depth bugtools/testing/selftests/bpf/progs/async_stack_depth.c+23 -20 replies

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/3] Two more fixes for check_max_stack_depth

I noticed two more bugs while reviewing the code, description and examples available in the patches.

One leads to incorrect subprog index to be stored in the frame stack maintained by the function (leading to incorrect tail_call_reachable marks, among other things).

The other problem is missing exploration pass of other async callbacks when they are not called from the main prog. Call chains rooted at them can thus bypass the stack limits (32 call frames * max permitted stack depth per function).

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

* Fix commit message for patch 2 (Alexei)

Kumar Kartikeya Dwivedi (3):
bpf: Fix subprog idx logic in check_max_stack_depth
bpf: Repeat check_max_stack_depth for async callbacks selftests/bpf: Add more tests for check_max_stack_depth bug

 kernel/bpf/verifier.c                         | 32 +++++++++++++++----
 .../selftests/bpf/progs/async_stack_depth.c   | 25 +++++++++++++--
 2 files changed, 48 insertions(+), 9 deletions(-)

base-commit: 9840036786d90cea11a90d1f30b6dc003b34ee67

Signature · 1 line
2.40.1