From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F24D3A7F4C; Fri, 4 Sep 2026 05:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788501519; cv=none; b=TpaqEE10qQf4orp7u/FAuwlb/u4+TRbSgwRpHqHbNP7cAsBHZ/iFCUBpmxzhhk7IjMAR3hxJCWERSR3suONVCTtbPQjK4qGa9amNnh3iG7XS8e3AoCy3c/z+58x6/RaQAqRzIHGTm8o2Y68BjPHvp2O2QVybZ9rdIjtjXWy9jmU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788501519; c=relaxed/simple; bh=NBRRYsn6cz0ONvxAvoaCAEbm0LEtRlPNIrr6REWG/9k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TPNR8u4tiRPsw1wxhp0Mm82cby41K8lgLfeVxMuQMwHr/fwE06nvKRL9I8ki8ovomdt22wVi7M8v6H79FNRUzPa9+gLzs5qaRjyVFWoeXHWztmzrEgEq7vLkhlKtQGZ18mDDzOoATnfGomOrcYl/JTB4X5jivlEMgDMjPJwaJQ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FiK+gARF; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="FiK+gARF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88AE91F00A3D; Fri, 4 Sep 2026 05:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788501518; bh=y89bGZEeM+tltf0btTnvjqRScHhz/N+jp+W67CqoTdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FiK+gARFYm6k8L73N1qPBbw63z1DOsvh89ZVfubUz7MiM95SMvCu9DAmREJq7Wklu Lx1HZ3jIWQ9XeYlZcXa2sjTw2/EiSLoQ60/jXJSZQOvS5uV74re4mzGt6C+1j1bw3X cW8WKSn3zKOUECNCCgUnOhwZKX7uBMmLvZB8i+2Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Muhammad Bilal , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 6.18 436/552] platform/x86: hp-bioscfg: bound ordered-list parsing by the package count Date: Fri, 4 Sep 2026 06:59:53 +0200 Message-ID: <20260904045800.478032280@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045747.813364717@linuxfoundation.org> References: <20260904045747.813364717@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Muhammad Bilal commit 1d143d78299d0eb4536698bf98c1815ec69f22a9 upstream. 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 Link: https://patch.msgid.link/20260709165900.30615-3-meatuni001@gmail.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c @@ -146,7 +146,7 @@ static int hp_populate_ordered_list_elem if (!order_obj) return -EINVAL; - for (elem = 1, eloc = 1; eloc < ORD_ELEM_CNT; elem++, eloc++) { + for (elem = 1, eloc = 1; eloc < ORD_ELEM_CNT && elem < order_obj_count; elem++, eloc++) { switch (order_obj[elem].type) { case ACPI_TYPE_STRING: