BACKPORT: sched: Fix yet more sched_fork() races
Where commit 4ef0c5c6 ("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 13765de8 ("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. Change-Id: If8d8fc38f2ab1334c45e530aaaedfc7b2825a7e5 Fixes: 4ef0c5c6 ("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 BUG: 221793230 (cherry picked from commit b1e82065) [quic_ashayj: Resolved minor merge conflicts] Signed-off-by:
Ashay Jaiswal <quic_ashayj@quicinc.com>
Loading
Please sign in to comment