CVE-2025-21771: sched_ext: Fix incorrect autogroup migration detection
In the Linux kernel, the following vulnerability has been resolved:
schedext: Fix incorrect autogroup migration detection
scxmovetask() is called from schedmovetask() and tells the BPF scheduler that cgroup migration is being committed. schedmovetask() is used by both cgroup and autogroup migrations and scxmovetask() tried to filter out autogroup migrations by testing the destination cgroup and PFEXITING but this is not enough. In fact, without explicitly tagging the thread which is doing the cgroup migration, there is no good way to tell apart scxmovetask() invocations for racing migration to the root cgroup and an autogroup migration.
This led to scxmovetask() incorrectly ignoring a migration from non-root cgroup to an autogroup of the root cgroup triggering the following warning:
WARNING: CPU: 7 PID: 1 at kernel/sched/ext.c:3725 scxcgroupcanattach+0x196/0x340 ... Call Trace: <TASK> cgroupmigrateexecute+0x5b1/0x700 cgroupattachtask+0x296/0x400 cgroupprocswrite+0x128/0x140 cgroupprocswrite+0x17/0x30 kernfsfopwriteiter+0x141/0x1f0 vfswrite+0x31d/0x4a0 x64syswrite+0x72/0xf0 dosyscall64+0x82/0x160 entrySYSCALL64afterhwframe+0x76/0x7e
Fix it by adding an argument to schedmovetask() that indicates whether the moving is for a cgroup or autogroup migration. After the change, scxmovetask() is called only for cgroup migrations and renamed to scxcgroupmovetask().
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-21771?
CVE-2025-21771 is considered to be a medium severity vulnerability due to its impact on task migration in the Linux kernel.
How do I fix CVE-2025-21771?
To fix CVE-2025-21771, you should update to the latest stable version of the Linux kernel where the vulnerability has been patched.
What systems are affected by CVE-2025-21771?
CVE-2025-21771 affects all versions of the Linux kernel that utilize cgroup and the BPF scheduler.
What are the consequences of CVE-2025-21771?
The consequences of CVE-2025-21771 include potential issues with task scheduling and resource allocation due to improper detection of autogroup migration.
Is there a workaround for CVE-2025-21771?
Currently, the recommended approach is to apply the official patch rather than relying on a workaround for CVE-2025-21771.