From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 A2ACD36923B for ; Mon, 3 Aug 2026 14:30:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785767454; cv=none; b=Gd6oxvivxTOQIKfaSFFeV6ztOuvJvgqv58NS6ddY613AktVItjFtMArkKPB1LplgS0ed7fCjppnzKMsFy1CBq1Xk6C0PwFXaby4N/X6cT86D0XPvXO0M+AdSiVaQR8wFVMdaiI4Rl91hL889L117KV0jFgbYDCIla+pxvphhcnM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785767454; c=relaxed/simple; bh=Q0pW4+satZfIqKx0mBryuqZBjn2UN7dJ4LdA64/mtGg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tn4US1QxFkJm+9Br/hikWC04nhiDW0jlPeXI5yAuQ2GiorxZr4+l5/54haMMAbMU8acuedr8G8W631stCfvZpiGJRQCf7xCIkk9Ru6vg4O2/BLeHvXBJZF1QXZ/4Ay+AzgRD5DSz1jpp+ZaAdg557h7YMhIGn+DxaeDOluU99XQ= 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=XPDu+n6J; arc=none smtp.client-ip=209.85.128.46 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="XPDu+n6J" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4954d29264cso11251955e9.2 for ; Mon, 03 Aug 2026 07:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785767449; x=1786372249; 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=RnLNKI0WhTuw3EJr1fdqDAe3jF7MiaCdXfP1m9k0dKE=; b=XPDu+n6JBihBJgjt2FYsMCLXTFBM5LFfQ+yzFU7LfBHwfspN4ZH3fKSt2UtWODxp7e pEFA6OCOGYUVDreKHTp0RrwFZp5loEta9xUuykKHK3Q/MMvicaza9aSFQTSfDcxjZNiY n0PNsklKCDBwJOl/5f/1pDl5LzAx59tgX0BYTDGjEwSPKtVtcZcDY+oyCmMCyUatL0Ps ruG1HBmg1OuvTMlo3yA4dHT8nCERCIYxe3vD8YSnta2WKIE7JiPRzPRYmlM5a9uYA4yN rc2cJWkPUf9eTscEbdI4BJ57b6T2oNzUDe7h5g8Vcae/82srIoPTd/bLAN6NYq1bQZn5 ToaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785767449; x=1786372249; 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=RnLNKI0WhTuw3EJr1fdqDAe3jF7MiaCdXfP1m9k0dKE=; b=nrPtokqpgjsQPiXe+n4L9ZCyYdGxO4nYoGe1rkGfyofP4a4HFkxF/FqOCKJqMDVL0o G6m+WKGtCkMeyiIKXBEuodnTZzzuOOCLtpCqlu9GfrIZX07kReyLnvYy5p/3zDoFxINK jzyU5akOVVIW7Pb72Zc52ajFfqQswr0ErYPC22NnlGpxZy9Hu01/R0wy0LaFy0ybo/dZ KSp6YqgOmau7/SCgiRGQuXXqEzerkO4jZjjhE02tYhvY1q3HgvmnCIs2FTkGHx1niwfl 2TWJ0SaopjypYmDBiKhgRWUv15IxuGl9xG27vOYgRprnI2nojyqGdj0v2P9FK1zJSc7X kGTg== X-Forwarded-Encrypted: i=1; AHgh+RqF5ZlOUZYcRJQ3/6l50QqsOBS0K9EgpEFyAzZi8IKnJfezYyZlgnn+gFzvtwriuo9B6CoVHarrlETsFRo=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7lEYBHNYgk4a8O0Uq6ov+DnDKfW6psSXmm6p2KE1ERqcRhHZJ GjtdMOZaFneq0/DupaFtSP7hLyXZ8jpW1d47GVkG4OwkdlMpTmzlphDY X-Gm-Gg: AR+sD136YQhFh9VNXjdCEZ9Mn0e1eh3Wrdr5cNO63SXXfv1QvQ0r3yxphyAKSlOmSCI IZwPst5MwlWJyNQW1NAECK+KsOcODH/OXqKTzWVLlpSuLPIhIhKfRzagctlDsWLdBlEb6kIKIUm DfG2vNXtzzWjb1fwftN+3iwoDmuMjCagWV2+LC5OAxim7LCY3gy8eornq5FedKdDcmD91ChPw8F cbtLhfFXUDINVxd+wVxWFH+7B/poxql9x3/npDwGEMvAkpH1vKWf4rEu01T/BvvRv3F/9qdJ1Le ++7drANzCBpiCQMX218zpVoA5SaFz2UFfTZq3HOBGUPPcU5D2Enf4Wad8w1tFSFcInFL49UsgAl cqW5t0H+SQMQ05ZWus+0Zw6gubrkdGfArxeNShs1V89TeGZrHEQpM60mCGsKWI6oA/PNVHmJt6j 5Eg453OSrJHtsPW6BoGnM2vZEP4mmGJbfpEPNw//2/O5VBtOgKMnkAMgHldhyzaxvW12B5jnvdP PzEWw656lxbWzNg+j0qC2okyjVSeMSyblbPjq19yw== X-Received: by 2002:a05:600c:c055:b0:498:702:8b81 with SMTP id 5b1f17b1804b1-4980c67639cmr143886565e9.16.1785767449156; Mon, 03 Aug 2026 07:30:49 -0700 (PDT) Received: from fedora ([202.47.63.86]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b98284sm236575295e9.12.2026.08.03.07.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 07:30:48 -0700 (PDT) From: Muhammad Bilal To: platform-driver-x86@vger.kernel.org Cc: jorge.lopez2@hp.com, hansg@kernel.org, ilpo.jarvinen@linux.intel.com, linux@weissschuh.net, linux-kernel@vger.kernel.org, meatuni001@gmail.com Subject: [PATCH 00/13] platform/x86: hp-bioscfg: fix multiple memory safety bugs and parsing errors Date: Mon, 3 Aug 2026 19:30:23 +0500 Message-ID: <20260803143037.93105-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 several bugs in the hp-bioscfg driver: 1. Memory safety issues (patches 1-6): - Off-by-one NUL terminator write in hp_get_string_from_buffer() - Heap OOB read in sk_store()/kek_store() when passing original count instead of trimmed length to hp_wmi_perform_query() - Heap OOB read on empty password write in validate_password_input() - 16-byte heap overflow in hp_calculate_security_buffer() for empty authentication tokens - Off-by-one heap OOB write in audit_log_entries_show() when more than 256 log entries are reported - Missing bounds check in the PSWD_ENCODINGS parsing loop 2. Logic bugs (patches 7-8): - new_password_store() incorrectly passing is_current=true, causing writes to land in current_password instead - ORD_LIST_ELEMENTS case using a stale NULL str_value pointer instead of converting the current ACPI element directly 3. ACPI package element index tracking (patches 9-13): - Five attribute-type parsers (enum, int, string, order-list, passwd) all share the same defect: multi-element array cases (PREREQUISITES, ENUM_POSSIBLE_VALUES, PSWD_ENCODINGS) consume "size" consecutive elements but the outer loop only advances by one, causing the next iteration to misread a leftover array entry as the next property and abort with -EIO Tested on HP EliteBook 840 G2 (BIOS M71 Ver. 01.31), kernel 7.2.0-rc5+, with CONFIG_KASAN_GENERIC=y and CONFIG_SLUB_DEBUG=y. This series applies on top of: commit ea4d8f8ba283 ("platform/x86: hp-bioscfg: fix slab-out-of-bounds write in hp_convert_hexstr_to_str") Muhammad Bilal (13): platform/x86: hp-bioscfg: fix off-by-one write in hp_get_string_from_buffer platform/x86: hp-bioscfg: fix heap OOB read in sk_store and kek_store platform/x86: hp-bioscfg: fix heap OOB read on empty password write platform/x86: hp-bioscfg: fix 16-byte heap overflow for empty auth token platform/x86: hp-bioscfg: fix off-by-one heap OOB write in audit_log_entries_show platform/x86: hp-bioscfg: add missing bounds check in PSWD_ENCODINGS loop platform/x86: hp-bioscfg: fix new_password_store overwriting current_password platform/x86: hp-bioscfg: fix ORD_LIST_ELEMENTS never being parsed platform/x86: hp-bioscfg: advance elem past consumed array elements in enum-attributes platform/x86: hp-bioscfg: advance elem past consumed array elements in int-attributes platform/x86: hp-bioscfg: advance elem past consumed array elements in string-attributes platform/x86: hp-bioscfg: advance elem past consumed array elements in order-list-attributes platform/x86: hp-bioscfg: advance elem past consumed array elements in passwdobj-attributes drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 2 +- .../platform/x86/hp/hp-bioscfg/enum-attributes.c | 4 ++++ drivers/platform/x86/hp/hp-bioscfg/int-attributes.c | 2 ++ .../x86/hp/hp-bioscfg/order-list-attributes.c | 6 +++++- .../x86/hp/hp-bioscfg/passwdobj-attributes.c | 13 +++++++++++-- .../platform/x86/hp/hp-bioscfg/spmobj-attributes.c | 6 +++--- .../platform/x86/hp/hp-bioscfg/string-attributes.c | 2 ++ .../x86/hp/hp-bioscfg/surestart-attributes.c | 2 +- 8 files changed, 29 insertions(+), 8 deletions(-) -- 2.55.0