All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET sched_ext/for-7.3] sched_ext: Follow-up fixes and missing cap enforcement
@ 2026-07-24 18:21 Tejun Heo
  2026-07-24 18:21 ` [PATCH 1/5] tools/sched_ext: Don't restart over a pending exit request Tejun Heo
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Tejun Heo @ 2026-07-24 18:21 UTC (permalink / raw)
  To: David Vernet, Andrea Righi, Changwoo Min
  Cc: sched-ext, Emil Tsalapatis, linux-kernel

Hello,

Follow-up fixes and enforcement holes plugged from the recent
sub-scheduler work. The first patch fixes the tools' restart loop
clobbering an exit that was requested while a restart was pending.

The rest tighten how cid-addressed operations from sub-schedulers are
handled when the caller lacks the necessary caps. Reenq to another
sched's local DSQs is now denied and counted, and a new event counts
the already-denied kicks. These checks are lockless - transient false
positives from cap rotation are harmless and false negatives can't
happen by visibility. cpuperf control moves behind a new SCX_CAP_PERF
which only the root holds by default, and scx_bpf_cidperf_set() reports
the result synchronously through a new versioned interface as its check
is authoritative under the target's rq lock.

 0001-tools-sched_ext-Don-t-restart-over-a-pending-exit-re.patch
 0002-sched_ext-Gate-local-DSQ-reenq-on-baseline-cid-acces.patch
 0003-sched_ext-Count-kicks-denied-for-lacking-baseline-ci.patch
 0004-sched_ext-Factor-out-scx_cpuperf_set.patch
 0005-sched_ext-Gate-scx_bpf_cidperf_set-behind-a-new-SCX_.patch

Based on sched_ext/for-7.3 (c509d8107026).

The patches are also available in the following git branch:

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git scx-sub-cap-gates

diffstat follows. Thanks.

 kernel/sched/ext/ext.c                   | 152 ++++++++++++++++++++++---------
 kernel/sched/ext/internal.h              |  31 ++++++-
 tools/sched_ext/include/scx/common.bpf.h |   2 +-
 tools/sched_ext/include/scx/compat.bpf.h |  18 ++++
 tools/sched_ext/scx_central.c            |   2 +-
 tools/sched_ext/scx_cpu0.c               |   2 +-
 tools/sched_ext/scx_flatcg.c             |   2 +-
 tools/sched_ext/scx_pair.c               |   2 +-
 tools/sched_ext/scx_qmap.bpf.c           |  17 ++--
 tools/sched_ext/scx_qmap.c               |   2 +-
 tools/sched_ext/scx_sdt.c                |   2 +-
 tools/sched_ext/scx_simple.c             |   2 +-
 tools/sched_ext/scx_userland.c           |  11 ++-
 13 files changed, 181 insertions(+), 64 deletions(-)

--
tejun

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCHSET v2 sched_ext/for-7.3] sched_ext: Follow-up fixes and missing cap enforcement
@ 2026-07-24 19:16 Tejun Heo
  2026-07-24 19:16 ` [PATCH 4/5] sched_ext: Factor out scx_cpuperf_set() Tejun Heo
  0 siblings, 1 reply; 11+ messages in thread
From: Tejun Heo @ 2026-07-24 19:16 UTC (permalink / raw)
  To: David Vernet, Andrea Righi, Changwoo Min
  Cc: sched-ext, Emil Tsalapatis, linux-kernel

Hello,

Follow-up fixes and enforcement holes plugged from the recent
sub-scheduler work. The first patch fixes the tools' restart loop
clobbering an exit that was requested while a restart was pending.

The rest tighten how cid-addressed operations from sub-schedulers are
handled when the caller lacks the necessary caps. Reenq to another
sched's local DSQs is now denied and counted, and a new event counts
the already-denied kicks. These checks are lockless - transient false
positives from cap rotation are harmless and false negatives can't
happen by visibility. cpuperf control moves behind a new SCX_CAP_PERF
which only the root holds by default, and scx_bpf_cidperf_set() reports
the result synchronously as its check is authoritative under the
target's rq lock.

v2: - Kernel-doc comment moved to scx_bpf_cpuperf_set() instead of being
      left attached to the factored-out helper (0004, reported by
      sashiko).
    - The versioned scx_bpf_cidperf_set___v2() interface and the tools
      compat wrapper are dropped. The cid-form interface is still under
      initial development, so the signature is changed in place to
      return s32 (0005).

v1: https://lore.kernel.org/r/20260724182125.985061-1-tj@kernel.org

 0001-tools-sched_ext-Don-t-restart-over-a-pending-exit-re.patch
 0002-sched_ext-Gate-local-DSQ-reenq-on-baseline-cid-acces.patch
 0003-sched_ext-Count-kicks-denied-for-lacking-baseline-ci.patch
 0004-sched_ext-Factor-out-scx_cpuperf_set.patch
 0005-sched_ext-Gate-scx_bpf_cidperf_set-behind-a-new-SCX_.patch

Based on sched_ext/for-7.3 (c509d8107026).

The patches are also available in the following git branch:

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git scx-sub-cap-gates-v2

diffstat follows. Thanks.

 kernel/sched/ext/ext.c                   | 139 +++++++++++++++++++++----------
 kernel/sched/ext/internal.h              |  31 ++++++-
 tools/sched_ext/include/scx/common.bpf.h |   2 +-
 tools/sched_ext/scx_central.c            |   2 +-
 tools/sched_ext/scx_cpu0.c               |   2 +-
 tools/sched_ext/scx_flatcg.c             |   2 +-
 tools/sched_ext/scx_pair.c               |   2 +-
 tools/sched_ext/scx_qmap.bpf.c           |  17 ++--
 tools/sched_ext/scx_qmap.c               |   2 +-
 tools/sched_ext/scx_sdt.c                |   2 +-
 tools/sched_ext/scx_simple.c             |   2 +-
 tools/sched_ext/scx_userland.c           |  11 +--
 12 files changed, 149 insertions(+), 65 deletions(-)

--
tejun

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-07-24 19:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 18:21 [PATCHSET sched_ext/for-7.3] sched_ext: Follow-up fixes and missing cap enforcement Tejun Heo
2026-07-24 18:21 ` [PATCH 1/5] tools/sched_ext: Don't restart over a pending exit request Tejun Heo
2026-07-24 18:21 ` [PATCH 2/5] sched_ext: Gate local DSQ reenq on baseline cid access Tejun Heo
2026-07-24 18:21 ` [PATCH 3/5] sched_ext: Count kicks denied for lacking " Tejun Heo
2026-07-24 18:21 ` [PATCH 4/5] sched_ext: Factor out scx_cpuperf_set() Tejun Heo
2026-07-24 18:30   ` sashiko-bot
2026-07-24 19:07     ` Tejun Heo
2026-07-24 18:21 ` [PATCH 5/5] sched_ext: Gate scx_bpf_cidperf_set() behind a new SCX_CAP_PERF Tejun Heo
2026-07-24 18:46   ` sashiko-bot
2026-07-24 19:07     ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2026-07-24 19:16 [PATCHSET v2 sched_ext/for-7.3] sched_ext: Follow-up fixes and missing cap enforcement Tejun Heo
2026-07-24 19:16 ` [PATCH 4/5] sched_ext: Factor out scx_cpuperf_set() Tejun Heo

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.