* [PATCH] ACPICA: Avoid walking the Namespace if StartNode is NULL
@ 2025-11-25 8:14 Cryolitia PukNgae
2025-11-25 9:00 ` WangYuli
2025-11-25 21:17 ` Rafael J. Wysocki
0 siblings, 2 replies; 3+ messages in thread
From: Cryolitia PukNgae @ 2025-11-25 8:14 UTC (permalink / raw)
To: Rafael J. Wysocki, Robert Moore, Len Brown
Cc: linux-acpi, acpica-devel, linux-kernel, Mingcong Bai,
Kexy Biscuit, Wentao Guan, zhanjun, niecheng1, Cryolitia PukNgae,
Cryolitia PukNgae
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPICA: Avoid walking the Namespace if StartNode is NULL
2025-11-25 8:14 [PATCH] ACPICA: Avoid walking the Namespace if StartNode is NULL Cryolitia PukNgae
@ 2025-11-25 9:00 ` WangYuli
2025-11-25 21:17 ` Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: WangYuli @ 2025-11-25 9:00 UTC (permalink / raw)
To: cryolitia.pukngae
Cc: acpica-devel, cryolitia, guanwentao, jeffbai, kexybiscuit, lenb,
linux-acpi, linux-kernel, niecheng1, rafael, robert.moore,
zhanjun, WangYuli
Great!
Reviewed-by: WangYuli <wangyl5933@chinaunicom.cn>
Thanks,
---
WangYuli
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPICA: Avoid walking the Namespace if StartNode is NULL
2025-11-25 8:14 [PATCH] ACPICA: Avoid walking the Namespace if StartNode is NULL Cryolitia PukNgae
2025-11-25 9:00 ` WangYuli
@ 2025-11-25 21:17 ` Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2025-11-25 21:17 UTC (permalink / raw)
To: Cryolitia PukNgae
Cc: Rafael J. Wysocki, Robert Moore, Len Brown, linux-acpi,
acpica-devel, linux-kernel, Mingcong Bai, Kexy Biscuit,
Wentao Guan, zhanjun, niecheng1, Cryolitia PukNgae
On Tue, Nov 25, 2025 at 9:14 AM Cryolitia PukNgae
<cryolitia.pukngae@linux.dev> wrote:
>
> 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" */
>
> ---
Applied as 6.19 material with adjusted subject and some edits in the changelog.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-25 21:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-25 8:14 [PATCH] ACPICA: Avoid walking the Namespace if StartNode is NULL Cryolitia PukNgae
2025-11-25 9:00 ` WangYuli
2025-11-25 21:17 ` Rafael J. Wysocki
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®