From: Tejun Heo <tj@kernel.org>
To: Cheng-Yang Chou <yphbchou0911@gmail.com>
Cc: sched-ext@lists.linux.dev, David Vernet <void@manifault.com>,
Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>,
Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
Chia-Ping Tsai <chia7712@gmail.com>
Subject: Re: [PATCH 1/2] sched_ext: Deny SCX kfuncs to non-SCX struct_ops programs
Date: Fri, 17 Apr 2026 08:53:40 -1000 [thread overview]
Message-ID: <c95fdfc9fcd55fe5323ae2d8d46fa274@kernel.org> (raw)
In-Reply-To: <20260416064715.1008437-2-yphbchou0911@gmail.com>
Hello,
A few things:
scx_kfunc_set_idle (ext_idle.c) isn't covered by the patch. Its kfuncs
(scx_bpf_cpu_node(), scx_bpf_get_idle_cpumask(), scx_bpf_pick_idle_cpu()
etc.) also call scx_prog_sched(aux) and hit the same OOB pattern on
non-SCX struct_ops programs. Please add an in_idle check in the filter
and treat it the same as in_any.
Separately, please also set .filter on scx_kfunc_set_idle itself. In
practice, the BPF core dedups filters per hook in
btf_populate_kfunc_set(), so the filter is already invoked for idle
kfuncs via the other sets' registrations on the same hook. But it's
confusing to read the code without setting .filter on every set.
The following line is too long - please break and indent (it gets
longer still once in_idle is added):
> + if (!(in_unlocked || in_select_cpu || in_enqueue || in_dispatch || in_cpu_release || in_any))
Once idle is covered, every SCX kfunc set ends up in this "context-
sensitive" list. At that point "context-sensitive" no longer
distinguishes anything - it just means "SCX kfuncs". Please update the
function-level comment and the two inline comments ("Not a context-
sensitive kfunc - allow." and "Non-SCX struct_ops: context-sensitive
kfuncs are not permitted.") to drop the term and talk about SCX kfuncs
directly.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-04-17 18:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 6:46 [PATCH sched_ext/for-7.1-fixes 0/2] sched_ext: Deny SCX kfuncs to non-SCX struct_ops programs Cheng-Yang Chou
2026-04-16 6:46 ` [PATCH 1/2] " Cheng-Yang Chou
2026-04-17 18:53 ` Tejun Heo [this message]
2026-04-18 6:50 ` Cheng-Yang Chou
2026-04-16 6:46 ` [PATCH 2/2] selftests/sched_ext: Add non_scx_kfunc_deny test Cheng-Yang Chou
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=c95fdfc9fcd55fe5323ae2d8d46fa274@kernel.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=chia7712@gmail.com \
--cc=jserv@ccns.ncku.edu.tw \
--cc=sched-ext@lists.linux.dev \
--cc=void@manifault.com \
--cc=yphbchou0911@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.