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: NPetr Holasek <pholasek@redhat.com> Acked-by: NDavid Rientjes <rientjes@google.com> Cc: Anton Arapov <anton@redhat.com> Link: http://lkml.kernel.org/r/20111208121640.GA2229@dhcp-27-244.brq.redhat.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
Showing
想要评论请 注册 或 登录