]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Merge tag 'sched_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 20 Feb 2022 20:40:20 +0000 (12:40 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 20 Feb 2022 20:40:20 +0000 (12:40 -0800)
Pull scheduler fix from Borislav Petkov:
 "Fix task exposure order when forking tasks"

* tag 'sched_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched: Fix yet more sched_fork() races

1  2 
kernel/fork.c

diff --cc kernel/fork.c
index bfa933473ff3fa912b4536f5ad6a2fb434bc6ecc,c607d238fc23bd599557debf11d741974f95aa8b..a024bf6254df895e7920372d4ef0cb94ac6e6d50
@@@ -2371,11 -2386,8 +2382,11 @@@ static __latent_entropy struct task_str
        syscall_tracepoint_update(p);
        write_unlock_irq(&tasklist_lock);
  
 +      if (pidfile)
 +              fd_install(pidfd, pidfile);
 +
        proc_fork_connector(p);
-       sched_post_fork(p, args);
+       sched_post_fork(p);
        cgroup_post_fork(p, args);
        perf_event_fork(p);