]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: hp-bioscfg: Fix out-of-bounds array access in ACPI package parsing
authorJunrui Luo <moonafterrain@outlook.com>
Fri, 26 Dec 2025 11:42:05 +0000 (19:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:16:48 +0000 (10:16 +0100)
commit79cab730dbaaac03b946c7f5681bd08c986e2abd
treebc87589eccf6c6cb24b472969e993b262f118248
parentfe9339b33e2b28d88946bacae7baaf24d467783a
platform/x86: hp-bioscfg: Fix out-of-bounds array access in ACPI package parsing

[ Upstream commit e44c42c830b7ab36e3a3a86321c619f24def5206 ]

The hp_populate_*_elements_from_package() functions in the hp-bioscfg
driver contain out-of-bounds array access vulnerabilities.

These functions parse ACPI packages into internal data structures using
a for loop with index variable 'elem' that iterates through
enum_obj/integer_obj/order_obj/password_obj/string_obj arrays.

When processing multi-element fields like PREREQUISITES and
ENUM_POSSIBLE_VALUES, these functions read multiple consecutive array
elements using expressions like 'enum_obj[elem + reqs]' and
'enum_obj[elem + pos_values]' within nested loops.

The bug is that the bounds check only validated elem, but did not consider
the additional offset when accessing elem + reqs or elem + pos_values.

The fix changes the bounds check to validate the actual accessed index.

Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Reported-by: Junrui Luo <moonafterrain@outlook.com>
Fixes: e6c7b3e15559 ("platform/x86: hp-bioscfg: string-attributes")
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB788173D7DD4EA2CB6383683DAFB0A@SYBPR01MB7881.ausprd01.prod.outlook.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
drivers/platform/x86/hp/hp-bioscfg/int-attributes.c
drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c
drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
drivers/platform/x86/hp/hp-bioscfg/string-attributes.c