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:	Thu, 6 Jan 2011 16:17:10 -0800
From:	Yinghai Lu <yinghai@...nel.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	"Luck, Tony" <tony.luck@...el.com>,
	"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...e.hu>,
	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Wu Fengguang <fengguang.wu@...el.com>,
	Bjorn Helgaas <bjorn.helgaas@...com>
Subject: Re: [GIT PULL] x86/apic changes for v2.6.38

On Thu, Jan 6, 2011 at 3:53 PM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> On Thu, Jan 6, 2011 at 3:48 PM, Luck, Tony <tony.luck@...el.com> wrote:
>> Untested on X86.  Builds and boots on ia64 (both normally and with
>> maxcpus=8 to limit the number of cpus).
>>
>> Signed-off-by: Tony Luck <tony.luck@...el.com>
>
> Looks much better to me, and gets rid of that silly #ifdef that I reacted to.
>
> But no hurry, this looks low-priority. So let's make this go through
> the x86 tree and get merged later, after it has passed whatever normal
> tests that the -tip tree goes through. Ok?

yes. x86 is safe. We have apicid_to_node[] array, and already check
apic id with MAX_LOCAL_APIC
in x86 version acpi_numa_processor_affinity_init().

looks ia64 is using struct array with cpu idx for mapping

        node_cpuid[srat_num_cpus].phys_id =
            (pa->apic_id << 8) | (pa->local_sapic_eid);
        /* nid should be overridden as logical node id later */
        node_cpuid[srat_num_cpus].nid = pxm;
        cpu_set(srat_num_cpus, early_cpu_possible_map);
        srat_num_cpus++;

but it does not check the boundary of that array...

struct node_cpuid_s node_cpuid[NR_CPUS]..

so if some one try to boot kernel with small NR_CPUS on bigger IA64
system, could get some variables node_cpuid[]...

Assume Tony will have another patch for IA64 to check that before
apply this patch.

sth like

Index: linux-2.6/arch/ia64/kernel/acpi.c
===================================================================
--- linux-2.6.orig/arch/ia64/kernel/acpi.c
+++ linux-2.6/arch/ia64/kernel/acpi.c
@@ -477,6 +479,11 @@ acpi_numa_processor_affinity_init(struct
 	if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
 		return;

+	if (srat_num_cpus >= NR_CPUS) {
+		printk(KERN_WARNING "NR_CPUS (%d) is too small, not all cpus used.
%d\n", NR_CPUS);
+		return;
+	}
+
 	pxm = get_processor_proximity_domain(pa);

 	/* record this node in proximity bitmap */


Thanks

Yinghai
--
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