summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
authorMuhammad Bilal <meatuni001@gmail.com>2026-07-09 21:58:57 +0500
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-07-10 11:11:30 +0300
commit1d143d78299d0eb4536698bf98c1815ec69f22a9 (patch)
tree780e50c3bced08f62096cdb1676aa8856e448e9f /include/uapi
parente0ddfd77c0c320b7d12b6c9169303b140b798775 (diff)
platform/x86: hp-bioscfg: bound ordered-list parsing by the package count
hp_populate_ordered_list_elements_from_package() differs from the other per-type parsers: its main loop is bounded only by the fixed per-type count and never checks elem against the number of elements actually present in the package, for (elem = 1, eloc = 1; eloc < ORD_ELEM_CNT; elem++, eloc++) whereas the string, integer, enumeration and password parsers bound their main loop with "elem < count" as well. This is safe today because hp_init_bios_package_attribute() rejects any package with fewer than ORD_ELEM_CNT elements before the parser runs. An upcoming change, however, relaxes that check to accept shorter packages. Bound the loop by the validated element count as well, so it stops at whichever comes first, the per-type count or the real package size, for (elem = 1, eloc = 1; eloc < ORD_ELEM_CNT && elem < order_obj_count; elem++, eloc++) order_obj_count is the validated element count, now correctly forwarded from the caller. No functional change for packages that enumerate correctly today. Cc: stable@vger.kernel.org Signed-off-by: Muhammad Bilal <meatuni001@gmail.com> Link: https://patch.msgid.link/20260709165900.30615-3-meatuni001@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'include/uapi')
0 files changed, 0 insertions, 0 deletions