From: Muhammad Bilal <meatuni001@gmail.com>
To: platform-driver-x86@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, ilpo.jarvinen@linux.intel.com,
hdegoede@redhat.com, jorge.lopez2@hp.com,
Thomas.Weissschuh@linutronix.de, superm1@kernel.org,
W_Armin@gmx.de, stable@vger.kernel.org,
Muhammad Bilal <meatuni001@gmail.com>
Subject: [PATCH v3 0/4] platform/x86: hp-bioscfg: fix ACPI package handling on HP EliteBook 840 G2
Date: Wed, 8 Jul 2026 01:21:07 +0500 [thread overview]
Message-ID: <20260707202111.35414-1-meatuni001@gmail.com> (raw)
This series fixes attribute enumeration failures on the HP EliteBook 840
G2 (BIOS M71 Ver. 01.31), whose BIOS returns shorter ACPI WMI packages
than hp_init_bios_package_attribute() currently accepts, plus occasional
type-mismatched elements after a failed WMI query.
Patches 1 and 2 are prerequisites: they make each per-type parser bound
itself on the real, validated package count instead of an incorrect value
derived from the NAME string's length. Both are no-ops today, since
every package the driver currently handles already meets the old
minimum size. They matter because patch 3 depends on them: once the
minimum size check is relaxed, the elements array can genuinely be
smaller than a parser's fixed per-type count, and without patches 1 and
2 this would result in an out-of-bounds heap read.
Patch 3 relaxes that minimum size check to accept packages missing
optional type-specific fields, as long as the common fields (NAME
through SECURITY_LEVEL) are present.
Patch 4 changes a type mismatch on one element from aborting the whole
attribute to warning and skipping the offending element, matching the
existing handling of unsupported element types.
Patches 1 through 3 are intended to be applied together, as patch 3
depends on the preparatory fixes in patches 1 and 2.
Changes since v2:
- Split the single "pass validated count and bound ordered list
parsing" patch into two: patch 1 fixes the count value passed to
each wrapper, patch 2 adds the missing elem < count bound to the
ordered list parser. (Ilpo)
- Rewrote patch 1's commit message to lead with the bug instead of
quoting code, and to state up front that a later patch depends on
it. (Ilpo)
- Reworded "thread the count down" and "guess at it" phrasing. (Ilpo)
Muhammad Bilal (4):
platform/x86: hp-bioscfg: pass validated element count to package
parsers
platform/x86: hp-bioscfg: bound ordered-list parsing by the package
count
platform/x86: hp-bioscfg: accept reduced ACPI packages from older HP
BIOS
platform/x86: hp-bioscfg: warn on element type mismatch instead of
failing
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 16 +++++++++++++---
drivers/platform/x86/hp/hp-bioscfg/bioscfg.h | 8 ++++++++
.../platform/x86/hp/hp-bioscfg/enum-attributes.c | 10 ++++++----
.../platform/x86/hp/hp-bioscfg/int-attributes.c | 3 ++-
.../x86/hp/hp-bioscfg/order-list-attributes.c | 7 ++++---
.../x86/hp/hp-bioscfg/passwdobj-attributes.c | 5 +++--
.../x86/hp/hp-bioscfg/string-attributes.c | 3 ++-
7 files changed, 38 insertions(+), 14 deletions(-)
--
2.55.0
next reply other threads:[~2026-07-07 20:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 20:21 Muhammad Bilal [this message]
2026-07-07 20:21 ` [PATCH v3 1/4] platform/x86: hp-bioscfg: pass validated element count to package parsers Muhammad Bilal
2026-07-08 10:54 ` Ilpo Järvinen
2026-07-07 20:21 ` [PATCH v3 2/4] platform/x86: hp-bioscfg: bound ordered-list parsing by the package count Muhammad Bilal
2026-07-08 10:58 ` Ilpo Järvinen
2026-07-07 20:21 ` [PATCH v3 3/4] platform/x86: hp-bioscfg: accept reduced ACPI packages from older HP BIOS Muhammad Bilal
2026-07-07 20:21 ` [PATCH v3 4/4] platform/x86: hp-bioscfg: warn on element type mismatch instead of failing Muhammad Bilal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260707202111.35414-1-meatuni001@gmail.com \
--to=meatuni001@gmail.com \
--cc=Thomas.Weissschuh@linutronix.de \
--cc=W_Armin@gmx.de \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jorge.lopez2@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=superm1@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox