Skip to content
Commit 54eed6cb authored by Petr Holasek's avatar Petr Holasek Committed by Ingo Molnar
Browse files

x86/numa: Add constraints check for nid parameters



This patch adds constraint checks to the numa_set_distance()
function.

When the check triggers (this should not happen normally) it
emits a warning and avoids a store to a negative index in
numa_distance[] array - i.e. avoids memory corruption.

Negative ids can be passed when the pxm-to-nids mapping is not
properly filled while parsing the SRAT.

Signed-off-by: default avatarPetr Holasek <pholasek@redhat.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Cc: Anton Arapov <anton@redhat.com>
Link: http://lkml.kernel.org/r/20111208121640.GA2229@dhcp-27-244.brq.redhat.com


Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 54c29c63
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment