From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 9E3C430BB8A for ; Tue, 7 Jul 2026 20:21:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783455710; cv=none; b=IYI1sYj4TC+H9lJJZbs/7Kk4dVzwoz6/mPT6PZxrOIcUr14tmV7ORahjEuNcqhh79tXBdW2f32yehc0J2Ux7GNd/CvBvtMeKuY/+g0UEfGtMu29hKY82KveTdymtAntl8iG83on5nqej8qq2ypz4tD1R+NoIEiWhw9WvJ4GwANE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783455710; c=relaxed/simple; bh=dKwM/3n0efJG7ZRg/nY3abzZr+UYyaTJWkieSpTZlc0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=a3I+HTKpTXFqKCDGLUKTdrTez32q424JdTsGJRc48c7AeRmbAPpoYqDJn4lFhLNZG5c17sGgNfpkvVdQf3BdjgNTUotzUAk9lTzaiz22QBjzi6yncPcxdOCnkIp/VxZuKF/32VoLxPZlczw1LgmnyI0bcMXWkDOWuE02uwm9Gyc= 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=Tih0d/4v; arc=none smtp.client-ip=209.85.218.42 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="Tih0d/4v" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-c125fbfbae0so476763866b.1 for ; Tue, 07 Jul 2026 13:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783455707; x=1784060507; 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=Mm3elO8712GK4l4hbfVHYSLDXC8IRHmSwT+OSMs7O8Y=; b=Tih0d/4vPPDSe3o0OXqKuyWStjsL1pzbuoXwmJEgXMQNOLJ94V6TJM00naqPDsDp+H khsq3fEhkY/86aEOyegHaG1YhQTxeOS5WD5KYJpRcKXzwPV9Vq6rSUJnf8WeSkkMqpF1 R8FYlibvmqTJbw8H45t9ZltmY1RhwkqiU+PqkhMa4Tk1L5BWBnacmT9/UWfUXIi7j3cS 6BcejqZPgcavLAVfsLXIt00KMOLpY0jrKe45OMb48XQpZ6ccx651QSUC8RPIRwV/BLHi I0JcWaHvffLsfwwNXFTJX5MDg5KkRcZS1dUDXCT7T44n/lRHzT5vIDFpqAMQJBxvuIQ2 0TTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783455707; x=1784060507; 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=Mm3elO8712GK4l4hbfVHYSLDXC8IRHmSwT+OSMs7O8Y=; b=B/Z5I8GzllPmLBrMPuN20Pzvd7rs5jAR8oJ9Pqt7HrbSNCAGpkb0SDKmZWRDf15pOn svqPnCJfspbt7AuSsDGvZQ1+yTRLFL687vJQE4Z3zIrMGzS/MQTxJG+7BLuhzqLrp2sV X9Smb1gne9UKjPsyOWP7y6ufW0U7xGQW0y2S0ZGCQJA0dbkdXJXxwb079o8HRqaFPgbO 0Heg6SwhQfV5GN0nn9RRyjfOBxEbfB+Ew1IF4svk6V1XqveSlzWHV4mhllsj2frwpEG7 uNIRXbzCOwVa4UtzkIaIEVh5LTF9M2zKRAa8XX4NNSI4xaeF8itXNW5+Qf96XxcVr/L4 T/0g== X-Gm-Message-State: AOJu0Yyxek4tWeGK8XwxCttRyiXQaoT6uSpptwMYD3GnuMSDnwwnEh/4 d5KvvBVBA/h3eKiqQPcRaTIe/UqDY1SaRD16De6zrt8iBN5jXxHQo76s X-Gm-Gg: AfdE7clK9Zla7ZTGZEr1LcWh5ORVJy9quITfhNs6n+9qU5t/WtL0JZzkNNYj6zKb0DZ FmzBKzlhtmRYOMNd5laB4xUdUR3KQAx6ZdgyeOCvVdBwIo/5VhGV9QrCJaChtd45NeK3njVagkz aEq/Y9b66Ik/CuP0RLX4h5mHpbECp70f/Ua+ilv4jXlxPMUTd0VrZ3y1b/uSzz6xrl+eSJYNS9M ZmZi2tEZU0XTD63Ur9upF3qxsrj8XGjWcRGdSFLNjLmpibaoXK57lE0n1d6KOzDwctX3eiRD4Xg HeJROffUoRbjwt5A3nA7RqGwwAgblQwPqLr6EVVzdnQ5xvvWl2U3ebeMVFOhmP3b7bpMhoopDoj ZtaNtFa4hlgPG6wMh52Iwk/F7MRn3TpXLEChfLWQSR/3fVc2RqrJmD6kxyMOb/Dl1LIGvPIUXoL t9yj0x6UAHOkhXwnl69G0OZ4AmQabO/5qkLlw2pYl4GW+pT1yHVbSK0nJQPdLDxag= X-Received: by 2002:a17:906:138d:b0:c12:86a5:3ada with SMTP id a640c23a62f3a-c15a67bc915mr265068366b.36.1783455706820; Tue, 07 Jul 2026 13:21:46 -0700 (PDT) Received: from node ([202.47.63.86]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-69aa6dba523sm637930a12.0.2026.07.07.13.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2026 13:21:46 -0700 (PDT) From: Muhammad Bilal 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 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 Message-ID: <20260707202111.35414-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. 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