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 E87DFC433EF for ; Mon, 13 Jun 2022 16:58:31 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=2/IDcZY0FhX0cb+aMzfVM0WKygodDJvFx0knrHO//Zg=; b=3Ur5PE954gm4SX yAw8seBqfZnEfqRNxCWLVuAIkSj4jrTWXEmwD+U6DsFSSPwCISE8qM+cKWDHK2vqzkdsNM9GV4K/5 M4wcfKPq796wOQRoiiztgNi5tpScObtibl4mIQbGabo8LOlti/h2i9dmLpdeLiREwqbJu1YfkSt5y myxy9+ZWbPbo9XYEnWETRCWCHo953d0mlCJcVbeL9J6ZWFn9nk5A0zowj1rFH+A09rjUB+xxNvuK+ 3PrXXBjZqhEgHuF7HkFvb5SCc0oeXk6clzJYx3If1bOEnu36ORil7LLLpZOLC7+b9yoTLKUaSnokL xq9P4IUAbGJ5uXJ1OqsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0nNc-004nwS-7h; Mon, 13 Jun 2022 16:57:32 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0nNY-004nuH-Pz for linux-arm-kernel@lists.infradead.org; Mon, 13 Jun 2022 16:57:30 +0000 Received: by mail-pg1-x534.google.com with SMTP id y187so6071981pgd.3 for ; Mon, 13 Jun 2022 09:57:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RijQ486Pj7q1I6Yn38ALOcEcbplPaBqHCcWTxz/xuwI=; b=F4cdR7lmoEVgQ5oNVOvniEhFcq0Sqs3otn0KnzTEIosNhmxwfi2m/cpXENay4DtgN9 ckqzCU1yUcS+zzYRn43VOsUa3UurRwtwR+YZcGkcOk7VxD7lDmAWoCjGd1yypTY15JJX 9rlp5+dbHMhjkTqjAcssQY777evhibHLI1Xzw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RijQ486Pj7q1I6Yn38ALOcEcbplPaBqHCcWTxz/xuwI=; b=N6/n4h1UmfFVt96DZVmkMeW+wNq2A8F0woFVDO7vBTKgH4kGz9MZpwcafqFDJgVhWH hLcK6x2wkXJJwflzlkBNrA84JOTbpm3qLaOMumXnWUPcK6AWz81xzyfban8wot9sfw+b a+Mb5GlHwVut4aIJ18gRKawHmambYspsMF0aGWtuMesVVapsxnk8yYcJxBONzPSMPeri Wzdb2pkVpOqFF5vvGqXF/DEHL43PP2V0wWkLD3qwQ7QkAM8cqStl+2dMmpVXVYn9JLmC AWn3gPu8K3Ki/Kgv2nK2GR0XJM3OHm0fbQ95QDQAnpAGf4oGudXxViLuLb4Vj+dC88RN WnbQ== X-Gm-Message-State: AJIora9Lc1C9v7FzVyaJJWdVaJdyOwQFSiB3FnpkfR3MGXovEZSaLk5Y +oFCiPDKckHMm1tUZbRxQlj3nIbxekIxhQ== X-Google-Smtp-Source: ABdhPJx7wMh/w7qZeXeEt0i3+2QliWtdYlrwdf96qW1SBleLkvmH6QXGKVBdQqF3BdDV9oCh/rFknw== X-Received: by 2002:a62:8e11:0:b0:51c:445b:5ae6 with SMTP id k17-20020a628e11000000b0051c445b5ae6mr280560pfe.48.1655139444566; Mon, 13 Jun 2022 09:57:24 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w76-20020a627b4f000000b0051bc5f4df1csm5644741pfc.154.2022.06.13.09.57.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 09:57:24 -0700 (PDT) Date: Mon, 13 Jun 2022 09:57:23 -0700 From: Kees Cook To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, Marc Zyngier , Will Deacon , Mark Rutland , Catalin Marinas , Mark Brown , Anshuman Khandual Subject: Re: [PATCH v4 23/26] arm64: head: remap the kernel text/inittext region read-only Message-ID: <202206130957.8C06460@keescook> References: <20220613144550.3760857-1-ardb@kernel.org> <20220613144550.3760857-24-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220613144550.3760857-24-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220613_095728_901184_75EDB39E X-CRM114-Status: GOOD ( 14.43 ) 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 On Mon, Jun 13, 2022 at 04:45:47PM +0200, Ard Biesheuvel wrote: > In order to be able to run with WXN from boot (which could potentially > be under a hypervisor regime that mandates this), update the temporary > kernel page tables with read-only attributes for the text regions before > attempting to execute from them. > > This is rather straight-forward for 16k and 64k granule configurations, > as the split between executable and writable regions is guaranteed to be > aligned to the granule used for the early kernel page tables. For 4k, it > involves installing a single table entry and populating it accordingly. > > Signed-off-by: Ard Biesheuvel Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel