mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cryolitia PukNgae <cryolitia.pukngae@linux.dev>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	 Robert Moore <robert.moore@intel.com>,
	Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev,
	 linux-kernel@vger.kernel.org, Mingcong Bai <jeffbai@aosc.io>,
	 Kexy Biscuit <kexybiscuit@aosc.io>,
	Wentao Guan <guanwentao@uniontech.com>,
	 zhanjun@uniontech.com, niecheng1@uniontech.com,
	 Cryolitia PukNgae <cryolitia@deepin.org>,
	 Cryolitia PukNgae <cryolitia.pukngae@linux.dev>
Subject: [PATCH] ACPICA: Avoid walking the Namespace if StartNode is NULL
Date: Tue, 25 Nov 2025 16:14:38 +0800	[thread overview]
Message-ID: <20251125-acpica-v1-1-99e63b1b25f8@linux.dev> (raw)

ACPICA commit 1c1b57b9eba4554cb132ee658dd942c0210ed20d

Since commit 0c9992315e73 ("ACPICA: Avoid walking the ACPI Namespace
if it is not there") fixed the situation that both StartNode and
AcpiGbl_RootNode is NULL. The Linux kernel mainline now still crashed
on Honor Magicbook 14 Pro[1]. Due to the access to the member of
ParentNode in AcpiNsGetNextNode, the NULL pointer dereference will
always happen, no matter whether the StartNode equals to the
ACPI_ROOT_OBJECT or not. So we move the check of StartNode being NULL
out of the if block.

Unfortunately, all the attempt to contact with Honor has failed, they
refused to provide any technical support for Linux. The bad DSDT
table's dump could be found on GitHub[2].

DMI: HONOR FMB-P/FMB-P-PCB, BIOS 1.13 05/08/2025

1. https://gist.github.com/Cryolitia/a860ffc97437dcd2cd988371d5b73ed7
2. https://github.com/denis-bb/honor-fmb-p-dsdt

Signed-off-by: Cryolitia PukNgae <cryolitia@deepin.org>
Link: https://github.com/acpica/acpica/pull/1061
Signed-off-by: Cryolitia PukNgae <cryolitia.pukngae@linux.dev>
---
 drivers/acpi/acpica/nswalk.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c
index a2ac06a26e92..5670ff5a43cd 100644
--- a/drivers/acpi/acpica/nswalk.c
+++ b/drivers/acpi/acpica/nswalk.c
@@ -169,9 +169,12 @@ acpi_ns_walk_namespace(acpi_object_type type,
 
 	if (start_node == ACPI_ROOT_OBJECT) {
 		start_node = acpi_gbl_root_node;
-		if (!start_node) {
-			return_ACPI_STATUS(AE_NO_NAMESPACE);
-		}
+	}
+
+	/* Avoid walking the namespace if the StartNode is NULL */
+
+	if (!start_node) {
+		return_ACPI_STATUS(AE_NO_NAMESPACE);
 	}
 
 	/* Null child means "get first node" */

---
base-commit: ac3fd01e4c1efce8f2c054cdeb2ddd2fc0fb150d
change-id: 20251125-acpica-efe5a5fc01d9

Best regards,
-- 
Cryolitia PukNgae <cryolitia.pukngae@linux.dev>



             reply	other threads:[~2025-11-25  8:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25  8:14 Cryolitia PukNgae [this message]
2025-11-25  9:00 ` WangYuli
2025-11-25 21:17 ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251125-acpica-v1-1-99e63b1b25f8@linux.dev \
    --to=cryolitia.pukngae@linux.dev \
    --cc=acpica-devel@lists.linux.dev \
    --cc=cryolitia@deepin.org \
    --cc=guanwentao@uniontech.com \
    --cc=jeffbai@aosc.io \
    --cc=kexybiscuit@aosc.io \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niecheng1@uniontech.com \
    --cc=rafael@kernel.org \
    --cc=robert.moore@intel.com \
    --cc=zhanjun@uniontech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®