CVE-2026-139509: sched_ext: Clear a sub-scheduler's caps before ops.sub_detach()
In the Linux kernel, the following vulnerability has been resolved:
schedext: Clear a sub-scheduler's caps before ops.subdetach()
A sub-scheduler can leave standing state behind on the cids delegated to it, cpuperf targets being the obvious case, and the kernel does not track who wrote it. Restoring it is the parent's job and ops.subdetach() is the place for it. Today the parent can't rely on that: the dying sub-scheduler keeps every cap until it is marked dead after ops.exit(), so its ops.exit() or a late timer can write after the parent has cleaned up.
Clear every cap of the sub-scheduler before ops.subdetach(). The pshard caps go first as a pending sync recomputes ecaps from them, and ecaps are then zeroed directly. A grant racing the clear is refused under the child's pshard lock, so nothing hands the caps back.
Affected Software
Event History
Frequently Asked Questions
What conditions are required for this issue to occur?
The issue involves sched_ext sub-schedulers that have been delegated cids and can leave capability state behind during detachment. It can occur when a sub-scheduler's exit handler or a late timer writes capability-related state after the parent has performed its cleanup.
What state can remain or be modified during the affected teardown sequence?
CPU performance targets are identified as an obvious example of standing state left on delegated cids. A dying sub-scheduler can retain caps until it is marked dead after ops.exit(), allowing it to write state after parent cleanup.
What behavior does the fix introduce?
The fix clears every cap held by the sub-scheduler before ops.sub_detach() runs. It clears pshard caps first so pending synchronization can recompute ecaps, then directly zeroes ecaps; grants racing the clear are refused under the child's pshard lock.