Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3335845yba; Mon, 6 May 2019 22:43:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmL7QQcwOirJUFtR0Lv08KrEWVA0V1OlUen+nfs1A++lbsaeaKbZA46jUtHQcL19ewxhX/ X-Received: by 2002:aa7:86c3:: with SMTP id h3mr37777348pfo.169.1557207786688; Mon, 06 May 2019 22:43:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557207786; cv=none; d=google.com; s=arc-20160816; b=Ky6aHtODsBD861u4lq+ZZYvAX9h8xlOTmpOnfcvQMAEjD4Bj3YTlW57PlSacC44rS9 IjG6aK02Bb2ek0hxCXqP41F3mnx+2FP7YaaR4XtftmnbqcSuUX7DyGNRFZvjaMGWzMn8 anu11L3Bqj0SoLJPvVZx5T8DSxzl4Abhmv0uDidkNRcR2iAhX8tErQ5Lc2vmwzUjmnTH D2ny04CEnY4lXbhxTIcsvifETVmkKSCaBpnNOP3oIveL5HEB3DLHEAw7rjCj4A/0vFm5 xJfFG9qc4S5lPwFYsD0jx/EhebArLVcM8Qo3bAbUCz0svLRk3pBrs9xPOe482WiRjHbh 6ohQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fhWD91QMJBlJhnXau9PoLbyxazRjh3a5wLSx5wIDbC8=; b=Xf6BWiH6fG7aSozhLySz1cMidXYZgUnqrzhST1UbJsy04YaxGb2U48CnQ1ptpyDWpU rNBaCo3vEvY5qTGCel4IpKGUuCLbsQScAKA2kOTnNGTUpSMKxo1cb7ZQT7I4IMLTNnlT brgyMl+iUllRFysCI9NOYuyes67AEEnaLa1nVaba+CRDjryLzYYP++8KZCS74rurJYKj dkf4NybrnwtacvJgQv0T7nnQ09aaSvrUSqPbwUsU/jc/AMEezqZFSCCmOSg+lRR6qP28 U/OZLh7x9P4CleDAIr+944PUWy1W3aNOhrYDufd80RkaYWnyzoW9NT5+RHzjtGxv0Np6 AQ7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="kh9FG/qw"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m73si18629657pga.271.2019.05.06.22.42.51; Mon, 06 May 2019 22:43:06 -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="kh9FG/qw"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729224AbfEGFkw (ORCPT + 99 others); Tue, 7 May 2019 01:40:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:60208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729211AbfEGFks (ORCPT ); Tue, 7 May 2019 01:40:48 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AAD41205ED; Tue, 7 May 2019 05:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557207647; bh=RigganWX4DUWno7wtAZgPTbcGgZR+KOR1pXcA44Ef6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kh9FG/qwVqu591wUlHDIqR6BoGjZj0jjvJS2lSepx3Bp4CK6AYrZ7WdeBGGuknmJF VwlplFsZTlPxnALWTg7zb/A4O4eSANgTOTdto47403ldtgW4FgtdiPo3OTZRbV0yR/ Jz9eGWhtRcDll+pVrDIxyCoOnZ9RW60LPRL3brPo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Erik Schmauss , Michael J Gruber , Bob Moore , "Rafael J . Wysocki" , Sasha Levin , linux-acpi@vger.kernel.org, devel@acpica.org Subject: [PATCH AUTOSEL 4.14 78/95] ACPICA: Namespace: remove address node from global list after method termination Date: Tue, 7 May 2019 01:38:07 -0400 Message-Id: <20190507053826.31622-78-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190507053826.31622-1-sashal@kernel.org> References: <20190507053826.31622-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 [ Upstream commit c5781ffbbd4f742a58263458145fe7f0ac01d9e0 ] 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: Sasha Levin --- drivers/acpi/acpica/nsobject.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/acpi/acpica/nsobject.c b/drivers/acpi/acpica/nsobject.c index 707b2aa501e1..099be6424255 100644 --- a/drivers/acpi/acpica/nsobject.c +++ b/drivers/acpi/acpica/nsobject.c @@ -222,6 +222,10 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node) } } + 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; -- 2.20.1