lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1358241318-20168-1-git-send-email-lig.fnst@cn.fujitsu.com>
Date:	Tue, 15 Jan 2013 17:15:18 +0800
From:	liguang <lig.fnst@...fujitsu.com>
To:	mingo@...hat.com, peterz@...radead.org, Morten.Rasmussen@....com,
	linux-kernel@...r.kernel.org
Cc:	liguang <lig.fnst@...fujitsu.com>
Subject: [PATCH] sched: reduce sched_domain_topology space

sched_domain_topology space was allocated by the size
ARRAY_SIZE(default_topology) + sched_domains_numa_levels,
suppose CONFIG_SCHED_SMT, CONFIG_SCHED_MC were y,
"static struct sched_domain_topology_level default_topology[] = {
         { sd_init_SIBLING, cpu_smt_mask, },
         { sd_init_MC, cpu_coregroup_mask, },
         { sd_init_CPU, cpu_cpu_mask, },
         { NULL, },
};"
then, ARRAY_SIZE(default_topology) equals to 4,
default_topology's NULL entry was accounted,
but, the following allocation for other sched_domains_numa_levels
entries was startd at 3(for default_topology[3].init is NULL),
so, 1 entry was forgot.

Signed-off-by: liguang <lig.fnst@...fujitsu.com>
---
 kernel/sched/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 257002c..6ba5ecf 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6241,7 +6241,7 @@ static void sched_init_numa(void)
 		}
 	}
 
-	tl = kzalloc((ARRAY_SIZE(default_topology) + level) *
+	tl = kzalloc((ARRAY_SIZE(default_topology) + level - 1) *
 			sizeof(struct sched_domain_topology_level), GFP_KERNEL);
 	if (!tl)
 		return;
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ