]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ACPI: Add out of bounds and numa_off protections to pxm_to_node()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 18 Aug 2020 14:24:25 +0000 (22:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:08:42 +0000 (11:08 +0100)
commitd2828ab0a92683e56e210cae4769af1f83519197
treef39dd60d4c3f5b2a0354b5fcf9c14703ccb40915
parent451a7c74c23b2ec42410ca5a7110c1a85ebae688
ACPI: Add out of bounds and numa_off protections to pxm_to_node()

[ Upstream commit 8a3decac087aa897df5af04358c2089e52e70ac4 ]

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>
drivers/acpi/numa.c