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
@@@ -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);