Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2470998yba; Mon, 15 Apr 2019 12:19:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJK8G0tSa5e5037KqdI41Hp71AfwLfNvOdlojgC87YPDtkyT9W+uLVSMpJd7bcv7Q5SCDB X-Received: by 2002:a17:902:2862:: with SMTP id e89mr58553094plb.203.1555355959781; Mon, 15 Apr 2019 12:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555355959; cv=none; d=google.com; s=arc-20160816; b=Usie0eiReRqrcurkZP9aryTGZYGQzgoNnuyH2Gv7jPJMJrjbCpMcWR+UJymRibeT/e BWz4A036J5g1Dj0so6blaGDNBbNV/YPttTQvzrtzeXti/4ZalP0kYGhee5tYe4JfxRrI pEBGhiBi0ldHVUeWOol0P2WN1ZOv+vvF+Fz/HSYvOLMnAy9fF454zFDi3x2ec4J+lbgD OWU65FaW++otdD7hvyVzINs6kCS3AVlcWHw9dlDDipn1rzLlcvzCmexPL9PGLz+H4ou+ lZwrUbW9QregCuYDMLJXWIl4RnyREPZGcLncvxyCsrd3wu6irkGRsrLPLyIBxfunEwPd nnlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4/uXcD9fNb2vm0yKgVX692EGwFWuCw87toutjTJ6q/4=; b=I7s77Lh+eFk3tKlyy7bl6+f8xKPS3a++rSQ+iJSBUVx0U4IuzraXikOil0U8cBE6Hj XxDv80KQIHQ3H4rPGASIwZ8ratOTQd8iuhTSQbBf/x8Sf3Sf6NvLIvi+t7jbnYM7w5Gk zQ2j8G8ZucFsvBzDVZF4PdnMzoxErI+ARo5e+1rLpcZG+PEN+1Kw4eQfLkk/jrS9/lYA mwICLnA8j5hSI+4wEWLdk+BGy8khoNmi3wGDsf4k506rUo/nxx8Q/feOeiEmURKiz8Ck tj4VA8Q9hvPk7lzXgO/+rr/pSwh1LGk89Ay295SImnszVHBHg8kW/v38tGDPShyP61aA 2q8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dCUHhnW6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g189si37494445pgc.112.2019.04.15.12.19.03; Mon, 15 Apr 2019 12:19:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dCUHhnW6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730837AbfDOTMD (ORCPT + 99 others); Mon, 15 Apr 2019 15:12:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:49182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731330AbfDOTMB (ORCPT ); Mon, 15 Apr 2019 15:12:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF1FF20880; Mon, 15 Apr 2019 19:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355520; bh=u/leh00119uEi4uCKhs5AiFBit2GgYy7Wfe/3rlZmZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dCUHhnW6zFKtWbyDR++x8Y8/JNmSYxd/b75OTSA+CHcMVqlxVe/+LX6zNZDBezeV4 hsoSw5j+WOPtpZx1mPTHLCg6R++1tmfsK7VXjEbk90GpdQjqyZFf1TyMA3eT57lA7V 3sTq7ZA3Txy+OmZ6lCH94GHIlsGTz+7PujHW6l4E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael J Gruber , Erik Schmauss , Bob Moore , "Rafael J. Wysocki" Subject: [PATCH 5.0 052/117] ACPICA: Namespace: remove address node from global list after method termination Date: Mon, 15 Apr 2019 21:00:22 +0200 Message-Id: <20190415183747.608079879@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183744.887851196@linuxfoundation.org> References: <20190415183744.887851196@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Erik Schmauss commit c5781ffbbd4f742a58263458145fe7f0ac01d9e0 upstream. ACPICA commit b233720031a480abd438f2e9c643080929d144c3 ASL operation_regions declare a range of addresses that it uses. In a perfect world, the range of addresses should be used exclusively by the AML interpreter. The OS can use this information to decide which drivers to load so that the AML interpreter and device drivers use different regions of memory. During table load, the address information is added to a global address range list. Each node in this list contains an address range as well as a namespace node of the operation_region. This list is deleted at ACPI shutdown. Unfortunately, ASL operation_regions can be declared inside of control methods. Although this is not recommended, modern firmware contains such code. New module level code changes unintentionally removed the functionality of adding and removing nodes to the global address range list. A few months ago, support for adding addresses has been re- implemented. However, the removal of the address range list was missed and resulted in some systems to crash due to the address list containing bogus namespace nodes from operation_regions declared in control methods. In order to fix the crash, this change removes dynamic operation_regions after control method termination. Link: https://github.com/acpica/acpica/commit/b2337200 Link: https://bugzilla.kernel.org/show_bug.cgi?id=202475 Fixes: 4abb951b73ff ("ACPICA: AML interpreter: add region addresses in global list during initialization") Reported-by: Michael J Gruber Signed-off-by: Erik Schmauss Signed-off-by: Bob Moore Cc: 4.20+ # 4.20+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpica/nsobject.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/acpi/acpica/nsobject.c +++ b/drivers/acpi/acpica/nsobject.c @@ -186,6 +186,10 @@ void acpi_ns_detach_object(struct acpi_n } } + if (obj_desc->common.type == ACPI_TYPE_REGION) { + acpi_ut_remove_address_range(obj_desc->region.space_id, node); + } + /* Clear the Node entry in all cases */ node->object = NULL;