Sched_ext development
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <arighi@nvidia.com>
Cc: David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	sched-ext@lists.linux.dev, Emil Tsalapatis <emil@etsalapatis.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCHSET sched_ext/for-7.2-fixes] sched_ext: Assorted sub-scheduler and cgroup fixes
Date: Fri, 17 Jul 2026 18:12:06 -1000	[thread overview]
Message-ID: <07c4ead225875c51af6599ee22c2e7a6@kernel.org> (raw)
In-Reply-To: <alnxrsexEe_nQwqL@gpd4>

Hello, Andrea.

On Fri, Jul 17, 2026 at 11:11:10AM +0200, Andrea Righi wrote:
> I randomly triggered the following with this applied, but it looks unrelated to
> these changes:
...
> This might be a pre-existent bug, I'll investigate a bit.

It is pre-existing. Cgroup migration doesn't update p->scx.sched, so a
task moved out of a sub-scheduler's cgroup keeps pointing at it. The
sub-scheduler's disable path only walks its own subtree and misses the
task, and the task ends up holding a dangling pointer once the scheduler
is freed. In your crash, the watchdog read a garbage timeout from the
recycled memory, declared a stall, and the exit propagation then chased
a garbage ->children pointer into scx_claim_exit().

Reproducer, on this branch, KASAN reports use-after-free within seconds:

1. Run scx_qmap.
2. Put a CPU hog in cgroup A.
3. scx_qmap -c /sys/fs/cgroup/A
4. Move the hog to a different cgroup.
5. Kill the sub-scheduler.

I have a fix series which re-homes tasks on cgroup migration in the
works and will post it soon.

Thanks.

--
tejun

  reply	other threads:[~2026-07-18  4:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 21:30 [PATCHSET sched_ext/for-7.2-fixes] sched_ext: Assorted sub-scheduler and cgroup fixes Tejun Heo
2026-07-16 21:30 ` [PATCH 1/4] sched_ext: Reject setting disallow from init_task outside the enable path Tejun Heo
2026-07-16 21:30 ` [PATCH 2/4] sched_ext: Take cgroup_lock() first in scx_cgroup_lock() Tejun Heo
2026-07-16 21:30 ` [PATCH 3/4] sched_ext: Skip sub-disable teardown for never-linked sub-schedulers Tejun Heo
2026-07-16 21:30 ` [PATCH 4/4] sched_ext: Don't enable non-ext tasks in the sub-sched task loops Tejun Heo
2026-07-17  9:11 ` [PATCHSET sched_ext/for-7.2-fixes] sched_ext: Assorted sub-scheduler and cgroup fixes Andrea Righi
2026-07-18  4:12   ` Tejun Heo [this message]
2026-07-18  5:34     ` Andrea Righi
2026-07-18  7:40 ` Tejun Heo

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=07c4ead225875c51af6599ee22c2e7a6@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=emil@etsalapatis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --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