]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa()
authorDietmar Eggemann <dietmar.eggemann@arm.com>
Mon, 1 Feb 2021 09:53:53 +0000 (10:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Mar 2022 08:10:41 +0000 (09:10 +0100)
commit6d93ffef8ccdc1f3da616c71ef1fe580c7a4a3af
tree3f2356f9937cce79afd748a23aef0b77d10e8d83
parente9386b547950742ae41536161711531d7eacd1b8
sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa()

commit 71e5f6644fb2f3304fcb310145ded234a37e7cc1 upstream.

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: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Vincent Guittot <vincent.guittot@linaro.org>
Tested-by: Barry Song <song.bao.hua@hisilicon.com>
Link: https://lkml.kernel.org/r/6000e39e-7d28-c360-9cd6-8798fd22a9bf@arm.com
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/sched/topology.c