From patchwork Mon Apr 8 20:42:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmauss, Erik" X-Patchwork-Id: 10890123 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6DD551390 for ; Mon, 8 Apr 2019 20:52:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D4EF2875C for ; Mon, 8 Apr 2019 20:52:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51160287E6; Mon, 8 Apr 2019 20:52:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BC462875C for ; Mon, 8 Apr 2019 20:52:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729067AbfDHUwv (ORCPT ); Mon, 8 Apr 2019 16:52:51 -0400 Received: from mga03.intel.com ([134.134.136.65]:41642 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728826AbfDHUws (ORCPT ); Mon, 8 Apr 2019 16:52:48 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 13:52:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,326,1549958400"; d="scan'208";a="141104056" Received: from bartok.jf.intel.com ([10.54.75.137]) by fmsmga007.fm.intel.com with ESMTP; 08 Apr 2019 13:52:48 -0700 From: Erik Schmauss To: linux-acpi@vger.kernel.org, rjw@rjwysocki.net Cc: Erik Schmauss , Bob Moore Subject: [PATCH 7/8] ACPICA: Namespace: add check to avoid null pointer dereference Date: Mon, 8 Apr 2019 13:42:29 -0700 Message-Id: <20190408204230.4335-8-erik.schmauss@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190408204230.4335-1-erik.schmauss@intel.com> References: <20190408204230.4335-1-erik.schmauss@intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);