Bad array index in arch/x86/mm/numa_64.c::debug_cpumask_set_cpu()

From: Jesper Juhl
Date: Thu Jan 13 2011 - 17:26:19 EST


Hi,

In arch/x86/mm/numa_64.c::debug_cpumask_set_cpu() we call
early_cpu_to_node() which may return NUMA_NO_NODE (which has the value
-1). This value is subsequently used as an index into
the 'node_to_cpumask_map' array and '-1' is not going to fly too wel as an
array index here.

This code comes from commit d906f0eb2f0e6d1a24c479f69a9c39e7e45c5ae8
"x86, numa: Fix CONFIG_DEBUG_PER_CPU_MAPS without NUMA emulation".

I must admit I have no idea what the best way to deal with this is, so
I'll just report it.

Happy bug fixing.

--
Jesper Juhl <jj@xxxxxxxxxxxxx> http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.

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