From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E29C751DAE1; Wed, 30 Sep 2026 17:53:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790790820; cv=none; b=o60nWSOJefJv0PyuUOZqXapLe2fdTW/VjEnOKGBvhc67Tn1tD+z5NPqWYGCQBFM7mVKIDUaZ/6uy3GAduVRRaa4wtdJbYBddSPmhhS2NhKS20UEmwzKO+t+apbCE2gfcJhkP2l3FgfNDLzcW+0ScI2e08wYdxufe9zcWLOauW04= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790790820; c=relaxed/simple; bh=ID6aYClGJFWjSFdWUyTY54AxsCYMm4IwO8uz2iOgtnc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h74FsekOYEujWI0lhIdT6Pk3J3fVyYKIWelH4e8sBALWsP17sPxprRX3KP0ePKtjrrYPkeuaPyxKkpFRD8tgWWxmLGJNYiZc/bG7dD2C3wwSQXZWDwYPkyyDZLkv2HDuqaB5EfAR3g9vrUjtYXO1NJGRprZsC6nU61p3tzm748E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qFuwsjgG; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qFuwsjgG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 350A51F000FF; Wed, 30 Sep 2026 17:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790790818; bh=8EDsZIxtf29i7zukvALGSyjOHlj8myecvgCs1UFAJx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qFuwsjgGJ+qLNecBE7CJ91vmcwl+hUPm3XKdcBL/m54U6pitqYm5qQDIhhw3yMOys Yemo87tnKO/iNp0LOwTd+rqtg7ZI+0q5W/9tLoVw9EJUrmYDfem4bGwM7ymtA6FvcR UZMSVZiTKYWCi8aeGktJpNVQBxGsKepWVP2m7RMg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xiang Mei , Weiming Shi , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.15 086/752] ACPICA: Fix NULL pointer dereference in acpi_ns_custom_package() Date: Wed, 30 Sep 2026 17:19:16 +0200 Message-ID: <20260930152400.029158804@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152358.131179731@linuxfoundation.org> References: <20260930152358.131179731@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Weiming Shi [ Upstream commit f8d14b7bb0063bbbd86c0e4d73edb8cea7b362bc ] acpi_ns_custom_package() unconditionally dereferences the first element of the package to read the _BIX version number, without checking for NULL: if ((*Elements)->Common.Type != ACPI_TYPE_INTEGER) When firmware returns a _BIX package whose first element is an unresolvable reference, ACPICA evaluates that entry to NULL. acpi_ns_remove_null_elements() does not strip NULL entries for ACPI_PTYPE_CUSTOM packages (fixed-position format would break if elements were shifted), so acpi_ns_custom_package() sees the NULL and causes a crash. Add a NULL check for the first element (version field) before dereferencing it. The caller then receives AE_AML_OPERAND_TYPE instead of crashing. Link: https://github.com/acpica/acpica/commit/f3f111b9013b Reported-by: Xiang Mei Reported-by: Weiming Shi Signed-off-by: Rafael J. Wysocki Link: https://patch.msgid.link/5674388.Sb9uPGUboI@rafael.j.wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpica/nsprepkg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/acpi/acpica/nsprepkg.c b/drivers/acpi/acpica/nsprepkg.c index 6742b50836f79..8cac751ab9753 100644 --- a/drivers/acpi/acpica/nsprepkg.c +++ b/drivers/acpi/acpica/nsprepkg.c @@ -631,6 +631,13 @@ acpi_ns_custom_package(struct acpi_evaluate_info *info, /* Get version number, must be Integer */ + if (!(*elements)) { + ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, + info->node_flags, + "Return Package has a NULL version element")); + return_ACPI_STATUS(AE_AML_OPERAND_TYPE); + } + if ((*elements)->common.type != ACPI_TYPE_INTEGER) { ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, info->node_flags, -- 2.53.0