From: Christian Loehle <christian.loehle@arm.com>
To: Nuoqi Gui <gnq25@mails.tsinghua.edu.cn>,
Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>
Cc: Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>, Shuah Khan <shuah@kernel.org>,
sched-ext@lists.linux.dev, bpf@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next 0/2] sched_ext: Mark scx_bpf_cpu_rq() nullable
Date: Fri, 19 Jun 2026 16:31:59 +0100 [thread overview]
Message-ID: <1b75c8ce-19c1-4a35-8747-d63e28dbbc16@arm.com> (raw)
In-Reply-To: <20260619-f01-14-scx-cpu-rq-ret-null-v1-0-3b4281cdf0da@mails.tsinghua.edu.cn>
On 6/19/26 15:45, Nuoqi Gui wrote:
> scx_bpf_cpu_rq() can return NULL for invalid CPU input or when no SCX
> scheduler is active, but its kfunc registration does not advertise the
> nullable return to the verifier.
>
> Add KF_RET_NULL to scx_bpf_cpu_rq(), matching the nullable metadata already
> present on neighboring SCX accessors, and add a sched_ext selftest that rejects
> an unchecked direct runqueue field read.
>
See 5c48d88fe004 ("sched_ext: deprecation warn for scx_bpf_cpu_rq()")
I guess I can send a patch to remove the function, it's been a while.
> This fixes a regression introduced by 6203ef73fa5c ("sched/ext: Add BPF
> function to fetch rq").
How so?
>
> Signed-off-by: Nuoqi Gui <gnq25@mails.tsinghua.edu.cn>
> ---
> Nuoqi Gui (2):
> sched_ext: Mark scx_bpf_cpu_rq() as nullable
> selftests/sched_ext: Cover scx_bpf_cpu_rq() null return
>
> kernel/sched/ext.c | 2 +-
> tools/testing/selftests/sched_ext/Makefile | 1 +
> .../selftests/sched_ext/cpu_rq_ret_null.bpf.c | 27 +++++++++++++++
> .../testing/selftests/sched_ext/cpu_rq_ret_null.c | 38 ++++++++++++++++++++++
> 4 files changed, 67 insertions(+), 1 deletion(-)
> ---
> base-commit: e4287bf34f97a88c7d9322f5bde828724c073a6b
> change-id: 20260617-f01-14-scx-cpu-rq-ret-null-2e79535acd57
>
> Best regards,
> --
> Nuoqi Gui <gnq25@mails.tsinghua.edu.cn>
>
>
next prev parent reply other threads:[~2026-06-19 15:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-19 14:45 Nuoqi Gui
2026-06-19 14:45 ` [PATCH bpf-next 1/2] sched_ext: Mark scx_bpf_cpu_rq() as nullable Nuoqi Gui
2026-06-19 14:45 ` [PATCH bpf-next 2/2] selftests/sched_ext: Cover scx_bpf_cpu_rq() null return Nuoqi Gui
2026-06-19 15:31 ` Christian Loehle [this message]
2026-06-19 16:02 ` Re: [PATCH bpf-next 0/2] sched_ext: Mark scx_bpf_cpu_rq() nullable Nuoqi Gui
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=1b75c8ce-19c1-4a35-8747-d63e28dbbc16@arm.com \
--to=christian.loehle@arm.com \
--cc=andrii@kernel.org \
--cc=arighi@nvidia.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=changwoo@igalia.com \
--cc=daniel@iogearbox.net \
--cc=gnq25@mails.tsinghua.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
--cc=void@manifault.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
all inboxes | Powered by JetHome®