ACPI: Add out of bounds and numa_off protections to pxm_to_node()
stable inclusion from linux-4.19.155 commit d2828ab0a92683e56e210cae4769af1f83519197 -------------------------------- [ Upstream commit 8a3decac ] The function should check the validity of the pxm value before using it to index the pxm_to_node_map[] array. Whilst hardening this code may be good in general, the main intent here is to enable following patches that use this function to replace acpi_map_pxm_to_node() for non SRAT usecases which should return NO_NUMA_NODE for PXM entries not matching with those in SRAT. Signed-off-by:Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by:
Barry Song <song.bao.hua@hisilicon.com> Reviewed-by:
Hanjun Guo <guohanjun@huawei.com> Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com> Signed-off-by:
Cheng Jian <cj.chengjian@huawei.com>
Loading
Please sign in to comment