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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 B322EC433DB for ; Sat, 6 Feb 2021 10:19:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B6D664E39 for ; Sat, 6 Feb 2021 10:19:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbhBFKSw (ORCPT ); Sat, 6 Feb 2021 05:18:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:40276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbhBFKSu (ORCPT ); Sat, 6 Feb 2021 05:18:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CD55E64E36; Sat, 6 Feb 2021 10:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612606689; bh=wr55LoISR2ISFhuMU+VVCrOBtBumxiExhIBQ3wCHFgI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=L/whPWQhKpZHXrjc/lwJS/qVd19A9KqWQqsUWI9UkNdQfvFYXq3frJit0af3+h/Us yEnKbbqwycP3kGfvDMKYkzM2w64qs4tnh5TPvfr7PT+4XGRR3vyH296+5W2QhqTu7X DrOTZ4GNx/Iv4AlaRN91hyHWeP2Bau+2LhjPd0YrKI0afa16fGKQ+RFKVOr+iAIXQX NYNm5vOh605frJDfSKeMpBj5Sn2+K1WBREtfNrjhA9CBkDsDpZBTzey0eej25BpQv9 2BD22w7Lqos9/w8NIfMxZV3d3D/jtzVBVFJsbdlmxmsus22DP/gHN5ZJ9+LxWdqyvA 0WPM97YBpay/Q== Received: by mail-ot1-f50.google.com with SMTP id k10so7112115otl.2; Sat, 06 Feb 2021 02:18:09 -0800 (PST) X-Gm-Message-State: AOAM53179MJ2/Caw2LXEda6sHpZB7feG9SiP1htfnOilgLei5ozJD5rX UvoQ0vuosYpfvt88/hxDAHP/DCy7E+XkWEjsPZA= X-Google-Smtp-Source: ABdhPJwks0SrxsDdLpt1PUeUPou3I4Jf5vuhtMAYKo6rqHcnqVYGLafX77qdLwgXNIB+vn/Dh0zsmujDiUKWHh/wbF4= X-Received: by 2002:a05:6830:1614:: with SMTP id g20mr6226305otr.77.1612606689022; Sat, 06 Feb 2021 02:18:09 -0800 (PST) MIME-Version: 1.0 References: <20200626155832.2323789-1-ardb@kernel.org> <20200626155832.2323789-3-ardb@kernel.org> <20210206031145.GA27503@dragon> In-Reply-To: From: Ard Biesheuvel Date: Sat, 6 Feb 2021 11:17:57 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/2] arm64/acpi: disallow writeable AML opregion mapping for EFI code regions To: Shawn Guo Cc: Linux ARM , Lorenzo Pieralisi , Kernel Hardening , Catalin Marinas , ACPI Devel Maling List , Sudeep Holla , Will Deacon , linux-arm-msm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Sat, 6 Feb 2021 at 09:10, Ard Biesheuvel wrote: > > On Sat, 6 Feb 2021 at 04:11, Shawn Guo wrote: > > > > 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 > > > > Can you check whether reverting > > 32cf1a12cad43358e47dac8014379c2f33dfbed4 > > fixes the issue too? > > If it does, please report this as a regression. The OS should not > modify firmware provided tables in-place, regardless of how they were > delivered. > That patch modifies firmware provided tables in-place, which invalidates checksums and TPM measurements, so it needs to be reverted in any case, and I have already sent out the patch for doing so. 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=-9.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 A5D8CC433E6 for ; Sat, 6 Feb 2021 10:19:30 +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 4DA4864E39 for ; Sat, 6 Feb 2021 10:19:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DA4864E39 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MQftcRwirIpRfLKzF/HXczX2tnDKYKu+aAaKdTHNjFQ=; b=jtxwcKVK8gDqRiWW8eMWPevRp PB96tJredKbkg5VH/KM1wnfkRfFAUJ0vEOXtGkfrNfYgv518EkjHEnGL1uNhDLwrzFmoB6kwoVrQz +KgE8AqgBSde6cdFhjXE0BZcJoii1dJg+Mw0adnpq62iy1NpELmO16Cb1g2jcXO2m5lmZf2IuxxDh d/lj/T5JfnxcDSHx3oPo8wiYoZt08VwGT4DnvuRdg4N53Y2Skhs9kocXJWdhrYV2aNy2BmLdI3z0h YmhqZimKbh7FcegA9RoiMjhBU2U4Pd+4MpDr1A61eN6//W+tcjAY5ano8oSXkLIvRFaUj/ysbwpyE vu6jGsr9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l8KfQ-0000M7-RM; Sat, 06 Feb 2021 10:18:16 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l8KfL-0000Fr-2Q for linux-arm-kernel@lists.infradead.org; Sat, 06 Feb 2021 10:18:15 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id C167664D73 for ; Sat, 6 Feb 2021 10:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612606689; bh=wr55LoISR2ISFhuMU+VVCrOBtBumxiExhIBQ3wCHFgI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=L/whPWQhKpZHXrjc/lwJS/qVd19A9KqWQqsUWI9UkNdQfvFYXq3frJit0af3+h/Us yEnKbbqwycP3kGfvDMKYkzM2w64qs4tnh5TPvfr7PT+4XGRR3vyH296+5W2QhqTu7X DrOTZ4GNx/Iv4AlaRN91hyHWeP2Bau+2LhjPd0YrKI0afa16fGKQ+RFKVOr+iAIXQX NYNm5vOh605frJDfSKeMpBj5Sn2+K1WBREtfNrjhA9CBkDsDpZBTzey0eej25BpQv9 2BD22w7Lqos9/w8NIfMxZV3d3D/jtzVBVFJsbdlmxmsus22DP/gHN5ZJ9+LxWdqyvA 0WPM97YBpay/Q== Received: by mail-ot1-f41.google.com with SMTP id f6so9455930ots.9 for ; Sat, 06 Feb 2021 02:18:09 -0800 (PST) X-Gm-Message-State: AOAM531zO1FLZSfj9JMmjeYF6rgrCSGWbQwuBlfmrdlCSWd8/idLIEDq 7z1GKFyk/c0V6niZOdJMKDbD1/F7LOFga5qrDUk= X-Google-Smtp-Source: ABdhPJwks0SrxsDdLpt1PUeUPou3I4Jf5vuhtMAYKo6rqHcnqVYGLafX77qdLwgXNIB+vn/Dh0zsmujDiUKWHh/wbF4= X-Received: by 2002:a05:6830:1614:: with SMTP id g20mr6226305otr.77.1612606689022; Sat, 06 Feb 2021 02:18:09 -0800 (PST) MIME-Version: 1.0 References: <20200626155832.2323789-1-ardb@kernel.org> <20200626155832.2323789-3-ardb@kernel.org> <20210206031145.GA27503@dragon> In-Reply-To: From: Ard Biesheuvel Date: Sat, 6 Feb 2021 11:17:57 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/2] arm64/acpi: disallow writeable AML opregion mapping for EFI code regions To: Shawn Guo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210206_051811_228333_5749C908 X-CRM114-Status: GOOD ( 20.46 ) 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 , Kernel Hardening , Catalin Marinas , linux-arm-msm@vger.kernel.org, ACPI Devel Maling List , Sudeep Holla , Will Deacon , Linux ARM 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 On Sat, 6 Feb 2021 at 09:10, Ard Biesheuvel wrote: > > On Sat, 6 Feb 2021 at 04:11, Shawn Guo wrote: > > > > 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 > > > > Can you check whether reverting > > 32cf1a12cad43358e47dac8014379c2f33dfbed4 > > fixes the issue too? > > If it does, please report this as a regression. The OS should not > modify firmware provided tables in-place, regardless of how they were > delivered. > That patch modifies firmware provided tables in-place, which invalidates checksums and TPM measurements, so it needs to be reverted in any case, and I have already sent out the patch for doing so. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 D28C9C433E0 for ; Sat, 6 Feb 2021 10:18:31 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id E7EB264E39 for ; Sat, 6 Feb 2021 10:18:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7EB264E39 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-20745-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 5196 invoked by uid 550); 6 Feb 2021 10:18:23 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 5156 invoked from network); 6 Feb 2021 10:18:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612606689; bh=wr55LoISR2ISFhuMU+VVCrOBtBumxiExhIBQ3wCHFgI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=L/whPWQhKpZHXrjc/lwJS/qVd19A9KqWQqsUWI9UkNdQfvFYXq3frJit0af3+h/Us yEnKbbqwycP3kGfvDMKYkzM2w64qs4tnh5TPvfr7PT+4XGRR3vyH296+5W2QhqTu7X DrOTZ4GNx/Iv4AlaRN91hyHWeP2Bau+2LhjPd0YrKI0afa16fGKQ+RFKVOr+iAIXQX NYNm5vOh605frJDfSKeMpBj5Sn2+K1WBREtfNrjhA9CBkDsDpZBTzey0eej25BpQv9 2BD22w7Lqos9/w8NIfMxZV3d3D/jtzVBVFJsbdlmxmsus22DP/gHN5ZJ9+LxWdqyvA 0WPM97YBpay/Q== X-Gm-Message-State: AOAM533AClgaN9VlQCKO9GqQKelRMoAS7rkqhdglYCzfdEq6ccXmTgXW tazGVQnV70mts+IrD34a9gr0nKdZW1VWbkwNy4U= X-Google-Smtp-Source: ABdhPJwks0SrxsDdLpt1PUeUPou3I4Jf5vuhtMAYKo6rqHcnqVYGLafX77qdLwgXNIB+vn/Dh0zsmujDiUKWHh/wbF4= X-Received: by 2002:a05:6830:1614:: with SMTP id g20mr6226305otr.77.1612606689022; Sat, 06 Feb 2021 02:18:09 -0800 (PST) MIME-Version: 1.0 References: <20200626155832.2323789-1-ardb@kernel.org> <20200626155832.2323789-3-ardb@kernel.org> <20210206031145.GA27503@dragon> In-Reply-To: From: Ard Biesheuvel Date: Sat, 6 Feb 2021 11:17:57 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/2] arm64/acpi: disallow writeable AML opregion mapping for EFI code regions To: Shawn Guo Cc: Linux ARM , Lorenzo Pieralisi , Kernel Hardening , Catalin Marinas , ACPI Devel Maling List , Sudeep Holla , Will Deacon , linux-arm-msm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Sat, 6 Feb 2021 at 09:10, Ard Biesheuvel wrote: > > On Sat, 6 Feb 2021 at 04:11, Shawn Guo wrote: > > > > 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 > > > > Can you check whether reverting > > 32cf1a12cad43358e47dac8014379c2f33dfbed4 > > fixes the issue too? > > If it does, please report this as a regression. The OS should not > modify firmware provided tables in-place, regardless of how they were > delivered. > That patch modifies firmware provided tables in-place, which invalidates checksums and TPM measurements, so it needs to be reverted in any case, and I have already sent out the patch for doing so.