From: dann frazier <dann.frazier@canonical.com>
To: stable@vger.kernel.org
Cc: Miao Xie <miaox@cn.fujitsu.com>,
Valentin Schneider <valentin.schneider@arm.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Barry Song <song.bao.hua@hisilicon.com>,
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
Sergei Trofimovich <slyfox@gentoo.org>,
Anatoly Pugachev <matorola@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH 5.10+5.4 2/3] sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa()
Date: Sat, 5 Mar 2022 09:44:29 -0700 [thread overview]
Message-ID: <20220305164430.245125-3-dann.frazier@canonical.com> (raw)
In-Reply-To: <20220305164430.245125-1-dann.frazier@canonical.com>
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
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>
---
kernel/sched/topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index f2951eba9592..ff2c6d3ba6c7 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1655,7 +1655,7 @@ void sched_init_numa(void)
/* Compute default topology size */
for (i = 0; sched_domain_topology[i].mask; i++);
- tl = kzalloc((i + nr_levels) *
+ tl = kzalloc((i + nr_levels + 1) *
sizeof(struct sched_domain_topology_level), GFP_KERNEL);
if (!tl)
return;
--
2.25.1
next prev parent reply other threads:[~2022-03-05 16:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-05 16:44 [PATCH 5.10+5.4 0/3] sched/topology: Fix missing scheduling domain levels dann frazier
2022-03-05 16:44 ` [PATCH 5.10+5.4 1/3] sched/topology: Make sched_init_numa() use a set for the deduplicating sort dann frazier
2022-03-05 16:44 ` dann frazier [this message]
2022-03-05 17:13 ` [PATCH 5.10+5.4 2/3] sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa() Joe Perches
2022-03-05 17:25 ` Joe Perches
2022-03-05 16:48 ` [PATCH 5.10+5.4 3/3] ia64: ensure proper NUMA distance and possible map initialization dann frazier
2022-03-05 19:50 ` [PATCH 5.10+5.4 0/3] sched/topology: Fix missing scheduling domain levels Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220305164430.245125-3-dann.frazier@canonical.com \
--to=dann.frazier@canonical.com \
--cc=akpm@linux-foundation.org \
--cc=dietmar.eggemann@arm.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-kernel@vger.kernel.org \
--cc=matorola@gmail.com \
--cc=miaox@cn.fujitsu.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=slyfox@gentoo.org \
--cc=song.bao.hua@hisilicon.com \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®