sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa()
mainline inclusion from mainline-v5.12-rc1 commit 71e5f664 category: bugfix bugzilla: 182847,https://gitee.com/openeuler/kernel/issues/I4EVBL CVE: NA ---------------------------------------------------------- Commit "sched/topology: Make sched_init_numa() use a set for the deduplicating sort" allocates 'i + nr_levels (level)' instead of 'i + nr_levels + 1' sched_domain_topology_level. This led to an Oops (on Arm64 juno with CONFIG_SCHED_DEBUG): sched_init_domains build_sched_domains() __free_domain_allocs() __sdt_free() { ... for_each_sd_topology(tl) ... sd = *per_cpu_ptr(sdd->sd, j); <-- ... } Signed-off-by: NDietmar Eggemann <dietmar.eggemann@arm.com> Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: NIngo Molnar <mingo@kernel.org> Tested-by: NVincent Guittot <vincent.guittot@linaro.org> Tested-by: NBarry Song <song.bao.hua@hisilicon.com> Link: https://lkml.kernel.org/r/6000e39e-7d28-c360-9cd6-8798fd22a9bf@arm.com Fixes: 620a6dc4 ("sched/topology: Make sched_init_numa() use a set for the deduplicating sort") Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com> Reviewed-by: NCheng Jian <cj.chengjian@huawei.com> Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
Showing
想要评论请 注册 或 登录