CVE-2026-99217: fork: release the files of a failed fork after sched_cancel_fork()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
fork: release the files of a failed fork after sched_cancel_fork()
Reorder copy_process() cleanup so sched_fork() taking scx_fork_rwsem scx_pre_fork() is safe and isn't held around exiting files. Right now, a fork that fails while another thread closed the bpf link fd will deadlock against its own read side. It also blocks every fork on the system:
copy_process() holds scx_fork_rwsem for read
exit_files()
close_files()
filp_close_sync()
bpf_scx_unreg()
kthread_flush_work() waits for the disable work
scx_root_disable()
percpu_down_write(&scx_fork_rwsem)
Simply release the child's files after sched_cancel_fork() dropped the lock. The task starts out as a copy of its parent so p->files points to the parent's table until copy_files() replaces it. exit_files() must not run for a fork that failed before that. Clear p->files up front so exit_files() is a no-op for those and make copy_files() set it explicitly for CLONE_FILES.
The Linux kernel CVE team has assigned CVE-2026-99217 to this issue.
Affected and fixed versions
===========================
Fixed in 6.12.115 with commit 27e1cbf8ec5f7117f6bb2d2e44030ac055f09097 Fixed in 6.18.60 with commit f7ac8500d58e7684d37403553b1dea90ee2b27b1 Fixed in 7.2.14 with commit 14c7de6ca239326b79fd3f7aee55dfada1bb72ab Fixed in 7.3.1 with commit afa8eb069694bd9f845e5e44eac6e81cbc06780e
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-99217
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/fork.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/27e1cbf8ec5f7117f6bb2d2e44030ac055f09097 https://git.kernel.org/stable/c/f7ac8500d58e7684d37403553b1dea90ee2b27b1 https://git.kernel.org/stable/c/14c7de6ca239326b79fd3f7aee55dfada1bb72ab https://git.kernel.org/stable/c/afa8eb069694bd9f845e5e44eac6e81cbc06780e https://git.kernel.org/stable/c/296a98c1fa50778c3b31eebed1a3f903f9684349