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 1AAA44E5358; Thu, 17 Sep 2026 17:56:30 +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=1789667791; cv=none; b=ErThgF6sLZoDpMAkpoEmT/FqjCaii+Jf82rhiTjNZ/4DLViHv1+bf6wcFbAk7pv/y2pNdh1MZ9CwvyMVDsYEwRw2DVd5h/sMXQnlQCHthkOxg063X+sEbwSVPfM3JsK6TN8GOISMBZhrKpNxdlxRkIk5PK58LxWsSlR8xXIDoo8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789667791; c=relaxed/simple; bh=RU8ozHPdqMMrVGf7fd3RJAObJ7MbCdHXq/TvzdpkO4o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XrsnCdjnTAAH1fOFmpo+PpzU8h3N8YKpRGATRLGyykFOAH/fgIz3cDpQQfsmIj/Ce2A4QzrKh0OVNt+bm2bQKKfZfqyDa40unubNr6ktABzn7Q8kNaXCzByjh6Bcc9ONKIshTF8NOi7QksfSislo5jXfbNekIUaM3K5gkVWvdnQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HA6ylO93; 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="HA6ylO93" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 721C11F000FF; Thu, 17 Sep 2026 17:56:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789667790; bh=/hjukLngYD6Uv9v9vdQY29+Rg+0TqGgo/YAvL8R9vPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HA6ylO93cmT3Y8mtKgT2hwzqCwKyyl/5biFv16y+vVt2wkB5+oAlC5WbK5aD46Gfl gi5szvCYVrpwnmO9b5hXvmphxvvi8bh1SpIxgtPM9e6ByG09HnDiXpzk0DS4iXlYiY elU4lzPoEqfO4Q91F6AyEOZJEnBLDJxegacFdL2c= 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 6.12 0172/1102] ACPICA: Fix NULL pointer dereference in acpi_ns_custom_package() Date: Thu, 17 Sep 2026 16:01:55 +0100 Message-ID: <20260917151543.860051681@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151539.408551884@linuxfoundation.org> References: <20260917151539.408551884@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 6.12-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 dd37fc108fce9..0b11622abed1b 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