From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3A41C433DB for ; Sat, 6 Feb 2021 03:13:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8692F64DF2 for ; Sat, 6 Feb 2021 03:13:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8692F64DF2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Jul0HmmmpTnoVXYSOqk47xLQQjZXFWht+34O+3QobEE=; b=wKx1R/FYl3anFCrkaoLZUvwKQ IaeUMz7d7aNUBKkYE91vWcRrOui+7QL0bDEzbFOSHwGnfdeGO3HBRUnA0wugTVzvCqtifsATjRanv gLqOwTRe2TCB86St7semw98HqWQWp5AXS8OawXtNODGEySvFbBsKkOflBewMKpwq9guyGNzWBplvv xADyHK3yep6HmwocgdSkECKGi8DY/um4joxQET98hfwNvj7BlJ8J8H539Uo5bHqvIB17obwsDhS33 x7/E/PiozNbOFbslwuEGLRMLFvebI+5HAoqz80+QqmmbprHFcDC/+tJfxdw4KWNLjahOLUT47Pj7y h+w6ynUSQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l8E0z-0000Ve-3G; Sat, 06 Feb 2021 03:12:05 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l8E0t-0000TW-Ez for linux-arm-kernel@lists.infradead.org; Sat, 06 Feb 2021 03:12:02 +0000 Received: by mail-pg1-x532.google.com with SMTP id t11so2187096pgu.8 for ; Fri, 05 Feb 2021 19:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=03Irav0Kn7d3PmwdWltq8yhVeaa7+Yo6U0jt6YgZEOM=; b=DFmxgNlGvwe3ViCthiyT2nkSLaQNiDYG62IdcIyg60j76khiIWkG7ZL85g/T/7FKrU OgrzGWOdftRv8IHcr0+PsU/nRTlgiC8Au4wV7DUkVkE9mtP/wAReUXv9qtUtxV3a7crt 8Ili36d2Ox8kFn/d1XX2mw2XaAaWF5VckKs4EIkTebWbOgDfZzt4tiLHbZSkIsEg6C1l FS8z8PWGIAIWh6ISTUTF+C6vHzMxBihpLduERWDRf3sx1iCQu0WS+a1KiB61ZL3OnreY 9nbgDin9ULICHYmKKpMUikJ4PqhKYl5AIEWMejBekc/JGZNFhYlRs6d55dOA3LPjTQgZ xLdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=03Irav0Kn7d3PmwdWltq8yhVeaa7+Yo6U0jt6YgZEOM=; b=uk280CddC8uv2aSm7xHIwQtRywvH7p+18pfq6KC5mW79csxkRnL8HlKxX1pRDRtpK7 9RRRbF1gFhHMS077ypW+ephcPkWvSEKmbMWfNw8akhknd0NrMxYhdtS7Q73jZdNjB9M5 194pZHo35GhFEHdE9GGLtAdRKTEIfsY8+5YdJvTBy35KBBOvRTrszCg8eZ5hxXnr92PY Qc8084a2IAmstgEruHTt58UBbiIw9QH5rjHax0TL7+WOk0OC1twLeCMRQHXz2CGmWRqZ y9esLVES7PasM/alxUWeac1qth0OAY3A8zK3U9GyjfmwDGNYEKogT5rZF/+cbxw+FWkK fE2g== X-Gm-Message-State: AOAM5318yi+7SXNf9iPyB4IcyZOp5igBHGOKKDVUl1UWa+C05C3fNVRT HnSo3ocpXgu6W92JonxXMUR/YQ== X-Google-Smtp-Source: ABdhPJwrsGW2P1pW+WkekABo8xTR+L+k0eCCXm8bQCwQQOAOFnKsiA1f6hb8gX5zfR74LatrZKR/7A== X-Received: by 2002:a62:5e44:0:b029:1a4:daae:e765 with SMTP id s65-20020a625e440000b02901a4daaee765mr7426181pfb.8.1612581113257; Fri, 05 Feb 2021 19:11:53 -0800 (PST) Received: from dragon (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id cq2sm9725597pjb.55.2021.02.05.19.11.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 19:11:52 -0800 (PST) Date: Sat, 6 Feb 2021 11:11:46 +0800 From: Shawn Guo To: Ard Biesheuvel Subject: Re: [PATCH v3 2/2] arm64/acpi: disallow writeable AML opregion mapping for EFI code regions Message-ID: <20210206031145.GA27503@dragon> References: <20200626155832.2323789-1-ardb@kernel.org> <20200626155832.2323789-3-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200626155832.2323789-3-ardb@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_221159_927944_662B5C3E X-CRM114-Status: GOOD ( 20.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lorenzo.pieralisi@arm.com, kernel-hardening@lists.openwall.com, catalin.marinas@arm.com, linux-arm-msm@vger.kernel.org, linux-acpi@vger.kernel.org, sudeep.holla@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ard, On Fri, Jun 26, 2020 at 05:58:32PM +0200, Ard Biesheuvel wrote: > Given that the contents of EFI runtime code and data regions are > provided by the firmware, as well as the DSDT, it is not unimaginable > that AML code exists today that accesses EFI runtime code regions using > a SystemMemory OpRegion. There is nothing fundamentally wrong with that, > but since we take great care to ensure that executable code is never > mapped writeable and executable at the same time, we should not permit > AML to create writable mapping. > > Signed-off-by: Ard Biesheuvel I'm booting Lenovo Flex 5G laptop with ACPI, and seeing this change causes a memory abort[1] when upgrading ACPI tables via initrd[2]. Dropping this change seems to fix the issue for me. But does that looks like a correct fix to you? Shawn [1] https://fileserver.linaro.org/s/iDe9SaZeNNkyNxG [2] Documentation/admin-guide/acpi/initrd_table_override.rst > --- > arch/arm64/kernel/acpi.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c > index 01b861e225b0..455966401102 100644 > --- a/arch/arm64/kernel/acpi.c > +++ b/arch/arm64/kernel/acpi.c > @@ -301,6 +301,15 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) > pr_warn(FW_BUG "requested region covers kernel memory @ %pa\n", &phys); > return NULL; > > + case EFI_RUNTIME_SERVICES_CODE: > + /* > + * This would be unusual, but not problematic per se, > + * as long as we take care not to create a writable > + * mapping for executable code. > + */ > + prot = PAGE_KERNEL_RO; > + break; > + > case EFI_ACPI_RECLAIM_MEMORY: > /* > * ACPI reclaim memory is used to pass firmware tables > -- > 2.27.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel