CVE-2026-31734: sched_ext: Fix is_bpf_migration_disabled() false negative on non-PREEMPT_RCU
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
sched_ext: Fix is_bpf_migration_disabled() false negative on non-PREEMPT_RCU
Since commit 8e4f0b1ebcf2 ("bpf: use rcu_read_lock_dont_migrate() for trampoline.c"), the BPF prolog (__bpf_prog_enter) calls migrate_disable() only when CONFIG_PREEMPT_RCU is enabled, via rcu_read_lock_dont_migrate(). Without CONFIG_PREEMPT_RCU, the prolog never touches migration_disabled, so migration_disabled == 1 always means the task is truly migration-disabled regardless of whether it is the current task.
The old unconditional p == current check was a false negative in this case, potentially allowing a migration-disabled task to be dispatched to a remote CPU and triggering scx_error in task_can_run_on_remote_rq().
Only apply the p == current disambiguation when CONFIG_PREEMPT_RCU is enabled, where the ambiguity with the BPF prolog still exists.
The Linux kernel CVE team has assigned CVE-2026-31734 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.18 with commit 8e4f0b1ebcf2180ab594f204f01279a666dadf3b and fixed in 6.18.22 with commit 72c43eb2e334febe93018cfb68ae828f55c6e49e Issue introduced in 6.18 with commit 8e4f0b1ebcf2180ab594f204f01279a666dadf3b and fixed in 6.19.12 with commit b4992a9446bb9a639007bfd32bf5c5a7e30199e5 Issue introduced in 6.18 with commit 8e4f0b1ebcf2180ab594f204f01279a666dadf3b and fixed in 7.0 with commit 0c4a59df370bea245695c00aaae6ae75747139bd
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-31734
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_idle.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/72c43eb2e334febe93018cfb68ae828f55c6e49e https://git.kernel.org/stable/c/b4992a9446bb9a639007bfd32bf5c5a7e30199e5 https://git.kernel.org/stable/c/0c4a59df370bea245695c00aaae6ae75747139bd