Skip to content

bpf: Consolidate sleepable context checks in verifier

Puranjay Mohan bpf 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: Consolidate sleepable checks in check_helper_call()kernel/bpf/verifier.c tools/testing/selftests/bpf/prog_tests/summarization.c tools/testing/selftests/bpf/progs/verifier_async_cb_context.c+20 -301 replyApplied
2/3bpf: Consolidate sleepable checks in check_kfunc_call()kernel/bpf/verifier.c+13 -231 replyApplied
3/3bpf: Consolidate sleepable checks in check_func_call()kernel/bpf/verifier.c tools/testing/selftests/bpf/progs/irq.c tools/testing/selftests/bpf/progs/preempt_lock.c+10 -111 replyApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMykyta YatsenkoEduard ZingermanKumar Kartikeya Dwivedi
1/3A-b A-b A-b
2/3A-b A-b A-b
3/3A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] bpf: Consolidate sleepable context checks in verifier

The BPF verifier has multiple call-checking functions that independently validate whether sleepable operations are permitted in the current context. Each function open-codes its own checks against active_rcu_locks, active_preempt_locks, active_irq_id, and in_sleepable, duplicating the logic already provided by in_sleepable_context().

This series consolidates these scattered checks into calls to in_sleepable_context() across check_helper_call(), check_kfunc_call(), and check_func_call(), reducing code duplication and making the error reporting consistent. No functional change.

Puranjay Mohan (3):
bpf: Consolidate sleepable checks in check_helper_call()
bpf: Consolidate sleepable checks in check_kfunc_call()
bpf: Consolidate sleepable checks in check_func_call()

 kernel/bpf/verifier.c                         | 91 +++++++------------
 .../selftests/bpf/prog_tests/summarization.c  |  2 +-
 tools/testing/selftests/bpf/progs/irq.c       |  4 +-
 .../selftests/bpf/progs/preempt_lock.c        |  6 +-
 .../bpf/progs/verifier_async_cb_context.c     |  4 +-
 5 files changed, 43 insertions(+), 64 deletions(-)

base-commit: 77378dabb50f593c756d393d8eacb0b91b758863

Signature · 1 line
2.52.0