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 Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06F79C28CF5 for ; Wed, 26 Jan 2022 17:30:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id AF70E49EDE; Wed, 26 Jan 2022 12:30:55 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gbC8c2me4n2q; Wed, 26 Jan 2022 12:30:54 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B12424A100; Wed, 26 Jan 2022 12:30:54 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 398F94A10E for ; Wed, 26 Jan 2022 12:30:53 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LnDaJNEVmUq6 for ; Wed, 26 Jan 2022 12:30:52 -0500 (EST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 4B03449EF0 for ; Wed, 26 Jan 2022 12:30:52 -0500 (EST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5E37EB81AC2; Wed, 26 Jan 2022 17:30:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7884C340E9; Wed, 26 Jan 2022 17:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643218250; bh=/28tCtfFancm5CCSx78Aad6xerDDMgMGm3g+HUtCuTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OsvhggZGrDPJhvViDZXQc5RW7Ur63e2g4/8sIHPWOeDixuKztRbv4sznJBVyIk41+ PTRx6lIWRnxuNZByeHNAvkvk6A3tuvRaHH+C3vwp/L8zGrYD+LcBfWNbm9Rzoo+UHJ IqcZjpA1SiwKX0avGzI7rbw4dsl3It/o2UkWR1STBeAIZKT8kpgOJUGslhBHDq1J6q ZnamH56hdQxfdh7/sL8v8hz3GIeQi9w7RKNEC/izsXjrzMsy8Ex4f/J9aIVcwHc4c6 butX3VGsAnAvqkK7MDoGimFUobGE850Oyej1Oefw0V2juAXSqNicItg9Pw8BaDiD3M 2Vif7+oZa849Q== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 11/12] arm64: efi: use set_pte_at() not set_pte() in order to pass mm pointer Date: Wed, 26 Jan 2022 18:30:10 +0100 Message-Id: <20220126173011.3476262-12-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220126173011.3476262-1-ardb@kernel.org> References: <20220126173011.3476262-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=854; h=from:subject; bh=/28tCtfFancm5CCSx78Aad6xerDDMgMGm3g+HUtCuTI=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBh8YUhx47G2Di37HBOTdk1WIh6QmR6R0DIRCPzQe3u Y9HyTc6JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYfGFIQAKCRDDTyI5ktmPJHlUC/ 9fpAGBHh3zml3pjMTEaSbLLUBTmAifHgqXDsTvzBaMFSF0AjLSXGwREtuZo/GjPv8vayjRlRH3qXYs wj3UdGjwglVOKGYXyz//a89HyX0yj4wbs6bluZzQ9lP/EGutJDydzRQw1lUBVxwN1GXBJl2JOzN3CE TYyEnmvOcFHAOo9SqMbyNaR0JpauoD9NJKPuQ1PdwVfl729t580jb50LS8vl+uVeMHZTme8Kb/IPLQ afhYrLIuHqqVqwyMMz8Xfzh1bSOQ2wpytn5fplrqMETqXtgjsPg0V5yWF3htw1lrrNHTf/1SAo5L0F EJM5xf/2icjJ15b+zUUYgsq1EnpBN992ztuWtCassP6GIjwGWPwefQgprtrBG3N9bDK29dDxhrohmo T09Ubm5WXu6Ve68zXBjeJWSWzdA6rDIyj4hl0ks3E3zZq43KCB3+fdUzipGaiw+k0ZOr+1g3uR8zrn z8NsR8XruDSBrpa3LJ+N0zOwDbpaz2B6ViCART/lXHuao= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, linux-hardening@vger.kernel.org, Catalin Marinas , Will Deacon X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu The set_pte() helper does not carry the struct mm pointer, which makes it difficult for the implementation to reason about the context in which the set_pte() call is taking place. So switch to set_pte_at() instead. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index e1be6c429810..e3e50adfae18 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -92,7 +92,7 @@ static int __init set_permissions(pte_t *ptep, unsigned long addr, void *data) pte = set_pte_bit(pte, __pgprot(PTE_RDONLY)); if (md->attribute & EFI_MEMORY_XP) pte = set_pte_bit(pte, __pgprot(PTE_PXN)); - set_pte(ptep, pte); + set_pte_at(&efi_mm, addr, ptep, pte); return 0; } -- 2.30.2 _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5592C63684 for ; Wed, 26 Jan 2022 17:30:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243740AbiAZRax (ORCPT ); Wed, 26 Jan 2022 12:30:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243708AbiAZRaw (ORCPT ); Wed, 26 Jan 2022 12:30:52 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3058C06161C for ; Wed, 26 Jan 2022 09:30:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 61E3CB81F83 for ; Wed, 26 Jan 2022 17:30:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7884C340E9; Wed, 26 Jan 2022 17:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643218250; bh=/28tCtfFancm5CCSx78Aad6xerDDMgMGm3g+HUtCuTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OsvhggZGrDPJhvViDZXQc5RW7Ur63e2g4/8sIHPWOeDixuKztRbv4sznJBVyIk41+ PTRx6lIWRnxuNZByeHNAvkvk6A3tuvRaHH+C3vwp/L8zGrYD+LcBfWNbm9Rzoo+UHJ IqcZjpA1SiwKX0avGzI7rbw4dsl3It/o2UkWR1STBeAIZKT8kpgOJUGslhBHDq1J6q ZnamH56hdQxfdh7/sL8v8hz3GIeQi9w7RKNEC/izsXjrzMsy8Ex4f/J9aIVcwHc4c6 butX3VGsAnAvqkK7MDoGimFUobGE850Oyej1Oefw0V2juAXSqNicItg9Pw8BaDiD3M 2Vif7+oZa849Q== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu, linux-hardening@vger.kernel.org, Ard Biesheuvel , Will Deacon , Marc Zyngier , Fuad Tabba , Quentin Perret , Mark Rutland , James Morse , Catalin Marinas Subject: [RFC PATCH 11/12] arm64: efi: use set_pte_at() not set_pte() in order to pass mm pointer Date: Wed, 26 Jan 2022 18:30:10 +0100 Message-Id: <20220126173011.3476262-12-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220126173011.3476262-1-ardb@kernel.org> References: <20220126173011.3476262-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=854; h=from:subject; bh=/28tCtfFancm5CCSx78Aad6xerDDMgMGm3g+HUtCuTI=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBh8YUhx47G2Di37HBOTdk1WIh6QmR6R0DIRCPzQe3u Y9HyTc6JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYfGFIQAKCRDDTyI5ktmPJHlUC/ 9fpAGBHh3zml3pjMTEaSbLLUBTmAifHgqXDsTvzBaMFSF0AjLSXGwREtuZo/GjPv8vayjRlRH3qXYs wj3UdGjwglVOKGYXyz//a89HyX0yj4wbs6bluZzQ9lP/EGutJDydzRQw1lUBVxwN1GXBJl2JOzN3CE TYyEnmvOcFHAOo9SqMbyNaR0JpauoD9NJKPuQ1PdwVfl729t580jb50LS8vl+uVeMHZTme8Kb/IPLQ afhYrLIuHqqVqwyMMz8Xfzh1bSOQ2wpytn5fplrqMETqXtgjsPg0V5yWF3htw1lrrNHTf/1SAo5L0F EJM5xf/2icjJ15b+zUUYgsq1EnpBN992ztuWtCassP6GIjwGWPwefQgprtrBG3N9bDK29dDxhrohmo T09Ubm5WXu6Ve68zXBjeJWSWzdA6rDIyj4hl0ks3E3zZq43KCB3+fdUzipGaiw+k0ZOr+1g3uR8zrn z8NsR8XruDSBrpa3LJ+N0zOwDbpaz2B6ViCART/lXHuao= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org The set_pte() helper does not carry the struct mm pointer, which makes it difficult for the implementation to reason about the context in which the set_pte() call is taking place. So switch to set_pte_at() instead. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index e1be6c429810..e3e50adfae18 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -92,7 +92,7 @@ static int __init set_permissions(pte_t *ptep, unsigned long addr, void *data) pte = set_pte_bit(pte, __pgprot(PTE_RDONLY)); if (md->attribute & EFI_MEMORY_XP) pte = set_pte_bit(pte, __pgprot(PTE_PXN)); - set_pte(ptep, pte); + set_pte_at(&efi_mm, addr, ptep, pte); return 0; } -- 2.30.2 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50717C28CF5 for ; Wed, 26 Jan 2022 17:55:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UT20ripQBF8s49HIEWuF0C+IELatKw41JpsZsfebTto=; b=QTJscWRNKr+SXU 8R+GM3VBguS5d31sBJhLaASFZ4TXakXgG7rlPQxV8ZlciMeZ6VYehrEIPI745opOXTaxYpBZbcKQg 1CVdaNg4DecyNIEeEC2ujueKRXEWA2VZhRCGHUcmBAl2LGk6Ql/wxVmHvu9XMc5MZ6CIvrybvkLI1 L0cABW0uQTOItEOMCI6L4msW1bQNLJ5p7Lw2HHXIDj+AfRU2nFCuz+2uStAgFsrZwNVeOMuQA4NBD CJuIqglQDhgKkzu0GVz1dcJY3IGJlt8O6tHQl3LhQRpVl+JtimJqctlNTxbvs0kZqclvP5L0cQgp6 WTHYgiVHpprRCOo8E9/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmUq-00D9NR-MT; Wed, 26 Jan 2022 17:54:17 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCm8C-00D0xU-MT for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 17:30:54 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5E37EB81AC2; Wed, 26 Jan 2022 17:30:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7884C340E9; Wed, 26 Jan 2022 17:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643218250; bh=/28tCtfFancm5CCSx78Aad6xerDDMgMGm3g+HUtCuTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OsvhggZGrDPJhvViDZXQc5RW7Ur63e2g4/8sIHPWOeDixuKztRbv4sznJBVyIk41+ PTRx6lIWRnxuNZByeHNAvkvk6A3tuvRaHH+C3vwp/L8zGrYD+LcBfWNbm9Rzoo+UHJ IqcZjpA1SiwKX0avGzI7rbw4dsl3It/o2UkWR1STBeAIZKT8kpgOJUGslhBHDq1J6q ZnamH56hdQxfdh7/sL8v8hz3GIeQi9w7RKNEC/izsXjrzMsy8Ex4f/J9aIVcwHc4c6 butX3VGsAnAvqkK7MDoGimFUobGE850Oyej1Oefw0V2juAXSqNicItg9Pw8BaDiD3M 2Vif7+oZa849Q== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu, linux-hardening@vger.kernel.org, Ard Biesheuvel , Will Deacon , Marc Zyngier , Fuad Tabba , Quentin Perret , Mark Rutland , James Morse , Catalin Marinas Subject: [RFC PATCH 11/12] arm64: efi: use set_pte_at() not set_pte() in order to pass mm pointer Date: Wed, 26 Jan 2022 18:30:10 +0100 Message-Id: <20220126173011.3476262-12-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220126173011.3476262-1-ardb@kernel.org> References: <20220126173011.3476262-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=854; h=from:subject; bh=/28tCtfFancm5CCSx78Aad6xerDDMgMGm3g+HUtCuTI=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBh8YUhx47G2Di37HBOTdk1WIh6QmR6R0DIRCPzQe3u Y9HyTc6JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYfGFIQAKCRDDTyI5ktmPJHlUC/ 9fpAGBHh3zml3pjMTEaSbLLUBTmAifHgqXDsTvzBaMFSF0AjLSXGwREtuZo/GjPv8vayjRlRH3qXYs wj3UdGjwglVOKGYXyz//a89HyX0yj4wbs6bluZzQ9lP/EGutJDydzRQw1lUBVxwN1GXBJl2JOzN3CE TYyEnmvOcFHAOo9SqMbyNaR0JpauoD9NJKPuQ1PdwVfl729t580jb50LS8vl+uVeMHZTme8Kb/IPLQ afhYrLIuHqqVqwyMMz8Xfzh1bSOQ2wpytn5fplrqMETqXtgjsPg0V5yWF3htw1lrrNHTf/1SAo5L0F EJM5xf/2icjJ15b+zUUYgsq1EnpBN992ztuWtCassP6GIjwGWPwefQgprtrBG3N9bDK29dDxhrohmo T09Ubm5WXu6Ve68zXBjeJWSWzdA6rDIyj4hl0ks3E3zZq43KCB3+fdUzipGaiw+k0ZOr+1g3uR8zrn z8NsR8XruDSBrpa3LJ+N0zOwDbpaz2B6ViCART/lXHuao= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_093052_931948_BBF95837 X-CRM114-Status: GOOD ( 13.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 The set_pte() helper does not carry the struct mm pointer, which makes it difficult for the implementation to reason about the context in which the set_pte() call is taking place. So switch to set_pte_at() instead. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index e1be6c429810..e3e50adfae18 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -92,7 +92,7 @@ static int __init set_permissions(pte_t *ptep, unsigned long addr, void *data) pte = set_pte_bit(pte, __pgprot(PTE_RDONLY)); if (md->attribute & EFI_MEMORY_XP) pte = set_pte_bit(pte, __pgprot(PTE_PXN)); - set_pte(ptep, pte); + set_pte_at(&efi_mm, addr, ptep, pte); return 0; } -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel