From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 3E88234E762 for ; Thu, 9 Jul 2026 16:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783616350; cv=none; b=JctrrKQqPDdKF5owX23ltoPs7bGh1mJ1QCYetPa7TyfeoVKuiC/y8t6C+6hehtPebTVci43OCIyROUCGgJ9dJNzOjCVKCpASGpCf/P9SOiWxiereKt15RP2ZYl+fWEb5HbkSKH+i3L9S3cPBFjKFpQjpljLqJDWWjkt9ELAP2Ak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783616350; c=relaxed/simple; bh=k53K0dGYW6Pb3pIUktGIXVCEU3Cc2tu3h7vVqnQbdyE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=aBBFTj/SS4gq2SGSgXZhtcbxRGo7TPrrmE7T3aOQd5dLJM/CqrEwy41hAp+IbCrKqF+T4V51iw0XBH/ivL4Ryg/fiTov/BicKkWUVgpMrjiysbAEs0XttT18Aa/hnRNCNHjyoFJNoQbpe3fzd0AFgljDIDlHTyXHkFlcI5T5FbY= 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=iqxWw0x0; arc=none smtp.client-ip=209.85.218.47 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="iqxWw0x0" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-c128cc012b4so8412866b.1 for ; Thu, 09 Jul 2026 09:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783616347; x=1784221147; 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=Xt6DhrngYbZFM9YuEunJlGx98mys1Ug0XoEi11S0kAY=; b=iqxWw0x0SByY/UqbtUPlG59WUICweiV27gkzyryhIEmgLPYCIDvS8lTRqcfK4xF5Qp Vs/krr/RaSunLICmnxic9kfS/PHIGeh87YdgifoyVFpyTOmAK+TI5lxVxVbcGfrcGvXX 2cGDCWZBxLsj8Smp1TIV869K1O2Tqwt0dTPMUALxexIH5LIWNfbM2cHBIkZZbg2vw26L eR8irfGGcnaIVMKq4kMV3XDd5VXiyOZk7QSfkqi3813kP7zqzxz9TRBOEAWNrz2qqjXk 0Knj/HTRjB8ys2o1k3L2Fknd/1uirldZDtcoiTL1anXCy4bX9O+/natzFBMuLH5wz5qK i4bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783616347; x=1784221147; 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=Xt6DhrngYbZFM9YuEunJlGx98mys1Ug0XoEi11S0kAY=; b=VTgbz2UlOpJh0EAGXpHGNP80AGep8LAl5aZTGhjYD5U0rTBvFXrwdDrBvMQJfy3DnL e+NShOOB2+8GgJRet1hW2S6TH7CtnUbNwQr6kedvxMGJVwiBPnxgglI82OKpIgnocMAb YYd3qaK572uHLmez2pM7727f2bZiECi+SypS6cpaVCORpPXc++C8WMVjnrejFhB68qYY YzLQqngRdw1u4lRGZLAyLN7HnpgWiUPlGCbmT+gjENaPkjU18pcEyfHhDm4IRsK2w5Y3 ia7MTI6oeH25iKo/xa6XrHDuL4W0BAPyMahFg0cN0445BxF5qSAxxR5/L6b5ni9fcqTU ZOHw== X-Forwarded-Encrypted: i=1; AHgh+RpnPvBTNX48iBWfFue1BAlOEwbTxucZzUMeo5LkHxQBUxjNkCTKjazzTKbdOtjxIsLujJhILV8IKwMhzcw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3QnUftuYdf4ZxMfW0urofUoK3o/rkBKc+MR+OU1LJv5IiPz85 1TGwNfWRFfs0oXyyzrLT7qEisnKNXt42Az9HbzEDdT8KlnBLzc7+MA0v X-Gm-Gg: AfdE7clY33jQlR9WKnWvLQDIQZgOUhjXGlO+TvqltJVtuGxe+B2xVQrkhAmBpctRJ4I b/sL+Tr9L4MrajSvm7iNEeYwcIDCUlY45zmI5wyf5fm4cjQhrDSm82TS6AhV+I0XO+i4XSdkt9W faE8Yr+Kv55wXbYN1hvj4au14DKC5z8aad7hFqeR7RUFyx3ISLXxih6y/HrsAHfFMZ31lVfK1E7 Wo/9rVTCwdGv7lKVXwONYYFHZvKChErd0o/LIXxMU3z/cxK6X/lfhGCrdgKy73swpj8+8M4FZIo 8+uvkMMmc6S/PGFAo019eby12BOBEDTdOJ7rvfsPA/QM6BHv9wThQ9fJCCynHmbC1sQplxthr4m Tw5uWduJJ2/GXjxDQ+Pd3hTnhB7rfWdOTNSgDqvEvWKwayIjcOks5AmD80uov3eLqEPGnU7qkOM Qq1KcJ2240Bcg8JkFyQDbNNlQZSRHqbbN23nDGwGYexaxWoFkZPWGm/2oHY+DXEmU= X-Received: by 2002:a17:907:a2cd:b0:c12:6280:33c9 with SMTP id a640c23a62f3a-c15fe8eba70mr3124066b.28.1783616346420; Thu, 09 Jul 2026 09:59:06 -0700 (PDT) Received: from node ([202.47.63.86]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c15c79f2a3fsm329902666b.49.2026.07.09.09.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 09:59:06 -0700 (PDT) From: Muhammad Bilal To: Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Jorge Lopez , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Mario Limonciello , Armin Wolf , Muhammad Bilal Subject: [PATCH v5 0/4] platform/x86: hp-bioscfg: fix ACPI package handling on HP EliteBook 840 G2 Date: Thu, 9 Jul 2026 21:58:55 +0500 Message-ID: <20260709165900.30615-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. v4: https://lore.kernel.org/all/20260708154846.12356-1-meatuni001@gmail.com/ Changes since v4: - Patch 1: added missing kerneldoc @foo_count entries for the five new parameters. (Ilpo) - No other code changes. 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 | 11 +++++++---- .../platform/x86/hp/hp-bioscfg/int-attributes.c | 4 +++- .../x86/hp/hp-bioscfg/order-list-attributes.c | 8 +++++--- .../x86/hp/hp-bioscfg/passwdobj-attributes.c | 6 ++++-- .../x86/hp/hp-bioscfg/string-attributes.c | 4 +++- 7 files changed, 43 insertions(+), 14 deletions(-) -- 2.55.0