Skip to contentSkip to conversation

CVE-2026-98865: sched_ext: Don't run ops.dequeue() with a DSQ lock held

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 18

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

sched_ext: Don't run ops.dequeue() with a DSQ lock held

ops.dequeue() is invoked with the source user DSQ's lock still held on the consume and move paths (scx_consume_dispatch_q(), move_task_between_dsqs()). A BPF scheduler which locks the source user DSQ from ops.dequeue() - e.g. by iterating it with bpf_iter_scx_dsq - self-deadlocks.

ops.dequeue() can only call the "any" kfuncs and none of them can lock a builtin DSQ, so the global and bypass paths can't deadlock; however, all DSQ locks share one lockdep class, so iterating any user DSQ from ops.dequeue() on those paths trips the recursion check.

Move the invocation after the DSQ unlock on all three paths. SCX_TASK_IN_CUSTODY is cleared under the lock serializing the transfer so that the callback is invoked exactly once.

The Linux kernel CVE team has assigned CVE-2026-98865 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 7.1 with commit ebf1ccff79c43f860cbd2f9d6cfab9a462d0cb2d and fixed in 7.2.10 with commit fe499ae9da46e297f578d4346c4c8e338c3118db
	Issue introduced in 7.1 with commit ebf1ccff79c43f860cbd2f9d6cfab9a462d0cb2d and fixed in 7.3-rc5 with commit cb86607ada73185f321baa7f9d94a08a3a40bbf5

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-98865

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
kernel/sched/ext/ext.c
kernel/sched/ext/internal.h
kernel/sched/ext/sub.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/fe499ae9da46e297f578d4346c4c8e338c3118db
	https://git.kernel.org/stable/c/cb86607ada73185f321baa7f9d94a08a3a40bbf5