fork: release the files of a failed fork after sched_cancel_fork()
No exploitation in the wild has been reported. Fixed in Kernel 6.12.115, Kernel 6.18.60, Kernel 7.2.14 and 1 more.
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.
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| linux-kernel: Kernel | <6.12.115, >=6.13.0 <6.18.60, >=6.19.0 <7.2.14, >=7.3.0 <7.3.1 | 6.12.115, 6.18.60, 7.2.14, 7.3.1 |
Timeline
Every event on this vulnerability
Embed
A live severity badge for an advisory, README or ticket