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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Feb 2011 21:27:37 +0300
From:	Cyrill Gorcunov <gorcunov@...il.com>
To:	Yinghai Lu <yinghai@...nel.org>
CC:	Tejun Heo <tj@...nel.org>, linux-kernel@...r.kernel.org,
	x86@...nel.org, brgerst@...il.com, shaohui.zheng@...el.com,
	rientjes@...gle.com, mingo@...e.hu, hpa@...ux.intel.com
Subject: Re: [PATCH 10/26] x86-64, NUMA: Move apicid to numa mapping initialization
 from amd_scan_nodes() to amd_numa_init()

On 02/15/2011 09:01 PM, Cyrill Gorcunov wrote:
> On 02/15/2011 08:54 PM, Yinghai Lu wrote:
> ...
>>
>> could just change
>>
>> - if (boot_cpu_physical_apicid> 0) {
>> + if (boot_cpu_physical_apicid != -1U) {
>> pr_info("BSP APIC ID: %02x\n", boot_cpu_physical_apicid);
>> apicid_base = boot_cpu_physical_apicid;
>> }
>>
>> Thanks
>>
>> Yinghai
>
> yup, that is exactly what Tejun suggested in first place ;) I'll update to
> this form and add your Acked-by then, ok?
>

Tejun I've updated it on top of your tj-numa/x86_64-numa-unify branch
and added Acks.

-- 
x86, numa: amd -- Check for screwed MADT table

In case if MADT table is corrupted we might end up
with boot_cpu_physical_apicid = -1U, corebits > 0 and
get out of __apicid_to_node array bound access. Check for
boot_cpu_physical_apicid being a sane value.

Signed-off-by: Cyrill Gorcunov <gorcunov@...nvz.org>
Acked-by: Tejun Heo <tj@...nel.org>
Acked-by: Yinghai Lu <yinghai@...nel.org>
---
  arch/x86/mm/amdtopology_64.c |    6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6.git/arch/x86/mm/amdtopology_64.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/mm/amdtopology_64.c
+++ linux-2.6.git/arch/x86/mm/amdtopology_64.c
@@ -212,14 +212,16 @@ void __init amd_fake_nodes(const struct
  {
  	unsigned int bits;
  	unsigned int cores;
-	unsigned int apicid_base = 0;
+	unsigned int apicid_base;
  	int i;

  	bits = boot_cpu_data.x86_coreid_bits;
  	cores = 1 << bits;
  	early_get_boot_cpu_id();
-	if (boot_cpu_physical_apicid > 0)
+	if (boot_cpu_physical_apicid != -1U)
  		apicid_base = boot_cpu_physical_apicid;
+	else
+		apicid_base = 0;

  	for (i = 0; i < nr_nodes; i++) {
  		int index;
--
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