]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Fix yet more sched_fork() races
authorPeter Zijlstra <peterz@infradead.org>
Mon, 14 Feb 2022 09:16:57 +0000 (10:16 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Sat, 19 Feb 2022 10:11:05 +0000 (11:11 +0100)
commit8198c37ad2849eac11ee68694c7cc27e3cb1b78a
tree75b3f3e6b2a396995b68db17b96efa51b4e499a6
parent9ef9d9575bfa54b166706bccee87f6694a1f3e7b
sched: Fix yet more sched_fork() races

Where commit 6e9fcdf29782 ("kernel/sched: Fix sched_fork() access an
invalid sched_task_group") fixed a fork race vs cgroup, it opened up a
race vs syscalls by not placing the task on the runqueue before it
gets exposed through the pidhash.

Commit c4692466afa2 ("sched/fair: Fix fault in reweight_entity") is
trying to fix a single instance of this, instead fix the whole class
of issues, effectively reverting this commit.

Fixes: 6e9fcdf29782 ("kernel/sched: Fix sched_fork() access an invalid sched_task_group")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Tested-by: Zhang Qiao <zhangqiao22@huawei.com>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Link: https://lkml.kernel.org/r/YgoeCbwj5mbCR0qA@hirez.programming.kicks-ass.net
include/linux/sched/task.h
kernel/fork.c
kernel/sched/core.c