Skip to content
Snippets Groups Projects
Commit af98db5f authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Yongqiang Liu
Browse files

sched: Fix yet more sched_fork() races

mainline inclusion
from mainline-v5.17-rc5
commit b1e8206582f9d680cff7d04828708c8b6ab32957
category: bugfix
bugzilla: 186609, https://gitee.com/openeuler/kernel/issues/I532B0


CVE: NA

--------------------------------

Where commit 4ef0c5c6b5ba ("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 13765de8148f ("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: 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid sched_task_group")
Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: default avatarTadeusz Struk <tadeusz.struk@linaro.org>
Tested-by: default avatarZhang Qiao <zhangqiao22@huawei.com>
Tested-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
Link: https://lkml.kernel.org/r/YgoeCbwj5mbCR0qA@hirez.programming.kicks-ass.net



conflict:
	include/linux/sched/task.h
	kernel/fork.c
	kernel/sched/core.c

Signed-off-by: default avatarZhang Qiao <zhangqiao22@huawei.com>
Reviewed-by: default avatarChen Hui <judy.chenhui@huawei.com>
Reviewed-by: default avatarWang Weiyang <wangweiyang2@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 742a0b5b
No related branches found
No related tags found
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment