public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Puranjay Mohan <puranjay@kernel.org>
To: bpf@vger.kernel.org
Cc: Puranjay Mohan <puranjay@kernel.org>,
	Puranjay Mohan <puranjay12@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <martin.lau@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>,
	kernel-team@meta.com
Subject: [PATCH bpf-next 0/3] bpf: Consolidate sleepable context checks in verifier
Date: Wed, 18 Mar 2026 10:43:23 -0700	[thread overview]
Message-ID: <20260318174327.3151925-1-puranjay@kernel.org> (raw)

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
-- 
2.52.0


             reply	other threads:[~2026-03-18 17:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 17:43 Puranjay Mohan [this message]
2026-03-18 17:43 ` [PATCH bpf-next 1/3] bpf: Consolidate sleepable checks in check_helper_call() Puranjay Mohan
2026-03-19  9:56   ` Kumar Kartikeya Dwivedi
2026-03-18 17:43 ` [PATCH bpf-next 2/3] bpf: Consolidate sleepable checks in check_kfunc_call() Puranjay Mohan
2026-03-19  9:57   ` Kumar Kartikeya Dwivedi
2026-03-18 17:43 ` [PATCH bpf-next 3/3] bpf: Consolidate sleepable checks in check_func_call() Puranjay Mohan
2026-03-19  9:57   ` Kumar Kartikeya Dwivedi
2026-03-21 20:20 ` [PATCH bpf-next 0/3] bpf: Consolidate sleepable context checks in verifier patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260318174327.3151925-1-puranjay@kernel.org \
    --to=puranjay@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=memxor@gmail.com \
    --cc=mykyta.yatsenko5@gmail.com \
    --cc=puranjay12@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox