From 52be61b3e551f5acc7b12b7a56f2cbc75cd5babe Mon Sep 17 00:00:00 2001 From: Erik Schmauss Date: Fri, 17 May 2019 14:21:36 +0800 Subject: [PATCH] ACPICA: Namespace: add check to avoid null pointer dereference mainline inclusion from mainline-5.1-rc4 commit df9271d69f40 category: bugfix bugzilla: 14713 CVE: NA ------------------------------------------------- ACPICA commit 7586a625f9c34c3169efd88470192bf63119e31a Some ACPICA userspace tools call acpi_ut_subsystem_shutdown() during cleanup and dereference a null pointer when cleaning up the namespace. Link: https://github.com/acpica/acpica/commit/7586a625 Signed-off-by: Erik Schmauss Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Signed-off-by: Xiongfeng Wang Reviewed-by: Yao Hongbo Signed-off-by: Yang Yingliang --- drivers/acpi/acpica/nsalloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index 5470213b8e64..6eb63db72249 100644 --- a/drivers/acpi/acpica/nsalloc.c +++ b/drivers/acpi/acpica/nsalloc.c @@ -74,6 +74,10 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) ACPI_FUNCTION_NAME(ns_delete_node); + if (!node) { + return_VOID; + } + /* Detach an object if there is one */ acpi_ns_detach_object(node); -- GitLab