From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 333D537206E for ; Wed, 8 Jul 2026 15:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783525734; cv=none; b=bofRKYgy1heHMCsS1RVGsRmWohvG3MoYNfFInP9ZgEEsiRkl3OZrCIZ4Q2OlIDvImIm0FSQ3txw+8oXWxtNNA3aInC5Qos/5tT3y4XsJfh6o7YOsVeL0AYPYZSi+jZ/IuC2zNQFcAhpTS47zKuRhzOS2VJPGtx7ebdgNLkNEO8E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783525734; c=relaxed/simple; bh=8QbeqJbFf9oi4h55Efl5R8F7Lfx9SdpLOJ/gAAydHD8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=s9zbFIr5PXT7c+BdhBq1eSep6uAhm/hauxniH6ErLdxjOrOHINjX8xUTayHvhdtnmgt9Bms2ZQjLbQ752f8P42P2qTdOXHf74ENuH+ucxq2gSf8CP7mq2G/YMGMI0luQdP9hRZ5DVNUx2WKKfSH7ZV4fNQKL9IFomEO4gfzxMOc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E4X7i1fk; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E4X7i1fk" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-698e5859a3cso9688a12.0 for ; Wed, 08 Jul 2026 08:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783525731; x=1784130531; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=8HYyhfh32LFwdBV4eDfTnSyUP2grGJ7M7W0Gn17mFP0=; b=E4X7i1fkS3Z40nI7+jpkxdQGzUL+RUBBDZtuVX33IO+WhcUc6C/KD9Mzy9B9nEW/d7 rK/G5GJ8uNypzkyhf1HUj2ofBuZ9vkusGajBwt0Tj+dMXtSWx7UYRfKHVjbt9lB2Vkeh OHdBWkvBHeFDlS8POuLuwaHU9u5GPYneOgBuiMByfWohBqeLZVkV71jEKpi2NiD2YWVw PZru7AoXShcvuXzIPCvC1qB3W0qc1h0RRnBhZB/aktOb5hQ3+epwfS3lWKVV7baIy5Ng 26mNZvc+b8UW3zee69cyJsIFzoS4dveZJbPabW1W5AACU18heUZKgAxxzG3zCRxt2ndZ zGag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783525731; x=1784130531; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=8HYyhfh32LFwdBV4eDfTnSyUP2grGJ7M7W0Gn17mFP0=; b=nYKUJMYAmHFHFhGqUfN2VKbdAel6dcRmguQYdOlzVGIQyXxsT/GguYqhrBeyNswDsr gWNrc394zPg2pDjD3y8MJnpIgnQwrGDiceV66Gk7EBAt+LHA0i5yjwunn8PAuXXlgQH0 Rw+9HEzcghzbFyae+umoKvLsXr4RqSf0aM6Dbe4uGNhBcCjYv2d/xqdI50TA6VCzVZ96 y41HQP2A9tCUzPk9qAZJ3Jf/QYJ5y97EybkzWaOskcYkWqWuSx+5qHcYRuihC13Rz4Pz LrIbnwzCKCNYlRjbca+PyhrXKCtFDGVxAlzgIRJ4dIle8VozJPodgKHfWhdcQ8hSSbn6 ACFA== X-Forwarded-Encrypted: i=1; AHgh+RppactR9rdFQLwMyCN7Hxj/aEtKlAbfFqzVg4u9xS1PhCq2UZapBCNlnr61hUOqtsTQAucB+qg60sFFLDI=@vger.kernel.org X-Gm-Message-State: AOJu0Yylc3P6Cq53ijuUAJ+x6avL7WeKFv1bJlAb66LHy4bpwLcSeeAn z7APaXZVP1kZs92HkPYG4rs/2cozIzTBentQz8WQNK4lZIbU4ZoDumtw X-Gm-Gg: AfdE7clsQcppdBYdEGXCHsceOxs0HE6urffN4geD7a5LxIXaTZKGKPDxf3obWg4JlIs pptpsH0kZqDc7Kmr1G9SombKC7OHF1n4zg4PVcMxMROzKJRpq8Nfn4w1OaTjM2Y7BnzdrYgzMLS bqa3/Q3yaHIlLH7xesyLyNbgmv2ieSA3O9LXiLIOnu3b/xvDS5JpKlAT1c+X8DXDsYG3pvI/X14 qjZ+Zl1ZuaENfy+8swaliU64YzcMYwUY/mt1+wwjWJzr536mxzRj7KlX6DMcEZC2u+6ghxNuHak hRMf8gpbIQpK5Ir/mg6QQ6lDm1d3Xd3bmCuIhqeVSiA5vKeT7Hg9k3AYc0ULn8Xua23PcQpHtg0 pi1FPSOPGi3jx07MT+gf9dR7JZzA/NCX83I8J2Xa+B9Yv5LqbEB4nSLcw0+Laa/yIslBWtmTVlP agL0ZUwCLJWAELODTzbPFsEQ2g+gYgjVhkTSasps11OZrF1DJNz13bIHy8HoROWmc= X-Received: by 2002:a05:6402:50ca:b0:698:ec2f:d6c9 with SMTP id 4fb4d7f45d1cf-69ab3c16be8mr1547585a12.14.1783525731269; Wed, 08 Jul 2026 08:48:51 -0700 (PDT) Received: from node ([202.47.63.86]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-69ac41d7ceesm945125a12.23.2026.07.08.08.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 08:48:50 -0700 (PDT) From: Muhammad Bilal To: hansg@kernel.org, ilpo.jarvinen@linux.intel.com, jorge.lopez2@hp.com, linux@weissschuh.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Mario Limonciello , Armin Wolf , Muhammad Bilal Subject: [PATCH v4 0/4] platform/x86: hp-bioscfg: fix ACPI package handling on HP EliteBook 840 G2 Date: Wed, 8 Jul 2026 20:48:41 +0500 Message-ID: <20260708154846.12356-1-meatuni001@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. v3: https://lore.kernel.org/all/20260707202111.35414-1-meatuni001@gmail.com/ Changes since v3: - Patch 1: dropped the Fixes: tag (the patch does not fix anything on its own; Cc: stable is enough for stable to pull it in as a series dependency) and reworded the forward reference from "a later patch" to "an upcoming change". (Ilpo) - Patch 2: dropped the Fixes: tag and reworded the forward reference as in patch 1, plus dropped the redundant sentence describing the out-of-bounds read. (Ilpo) - No code changes; commit-message wording only. 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