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=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 93B64C55178 for ; Wed, 28 Oct 2020 14:11:26 +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 0EEBD24726 for ; Wed, 28 Oct 2020 14:11:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SOmWOYG3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ptgtRzPW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EEBD24726 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: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=zDp4eoM3/cxOIeRf4IdgEUwb5+zDlStLYE3CoP6ojWw=; b=SOmWOYG3m6HeEBjhYeS+zSzVe juujcg0VBpVUaYSrU+DCXD8dgXpXDSk4fMwTA/HEMnhWjE7VpLs8TfiGalSU9CEG1Wj1tRfX1ww6M z5WtqYDzGxpQ85DeDojj/O0jwzDhh8zDePAFUESgo8lxBM3hPtoKvKH4sgnqFTVJEN1Rg2hHSzkHw JVRSXomK9O1k2qwBdhtDVjiKrp54k7t8u7HIXoStGrcbGAZ201RZYcd+FGmcakvlef93Vn5s+zC2z 5egz0+F3NB7+5qpOr4Jhew/+JhwIeQX4NCfgX4Cw+A0DkSTA4vhQFatKPpb03AHi5ZRP7r0SA0fHG UxIlI0+9Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXmAD-0000KE-Do; Wed, 28 Oct 2020 14:10:57 +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 1kXmAA-0000I5-6r for linux-arm-kernel@lists.infradead.org; Wed, 28 Oct 2020 14:10:55 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F241A24726; Wed, 28 Oct 2020 14:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603894253; bh=8aae71uvr4i6vTP9NJJ2/8+fdRdvt2XaJLMgOCwIcj8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ptgtRzPW/A3ak+iVFx8EilbdKb9PzCkS+wvGpARYIFqs/m3n7csgDyFYTm5rbazEA ZpJujuYkAPWtCxFRX0lwI+yBBNNizHEQeRNaBW4n1jnkGstUVL7paTeXsfgV4PapTD a9n/eix5k1wgxiNcPKAIdVlQxwKTWHxgC1k7iVaU= Date: Wed, 28 Oct 2020 14:10:48 +0000 From: Will Deacon To: Ard Biesheuvel Subject: Re: [PATCH 2/4] arm64: omit [_text, _stext) from permanent kernel mapping Message-ID: <20201028141048.GC28554@willie-the-truck> References: <20201027073209.2897-1-ardb@kernel.org> <20201027073209.2897-3-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201027073209.2897-3-ardb@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201028_101054_457642_043B3C16 X-CRM114-Status: GOOD ( 19.26 ) 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: mark.rutland@arm.com, catalin.marinas@arm.com, james.morse@arm.com, 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 On Tue, Oct 27, 2020 at 08:32:07AM +0100, Ard Biesheuvel wrote: > In a previous patch, we increased the size of the EFI PE/COFF header > to 64 KB, which resulted in the _stext symbol to appear at a fixed > offset of 64 KB into the image. > > Since 64 KB is also the largest page size we support, this completely > removes the need to map the first 64 KB of the kernel image, given that > it only contains the arm64 Image header and the EFI header, none of which > we ever access again after booting the kernel. More importantly, we should > avoid an executable mapping of non-executable and not entirely predictable > data, in the unlikely event that we emitted something that looks like an > opcode that could be used as a gadget for speculative execution. > > So let's limit the kernel mapping of .text to the [_stext, _etext) region, > which matches the view of generic code (such as kallsyms) when it reasons > about the boundaries of the kernel's .text section. > > Signed-off-by: Ard Biesheuvel > --- > arch/arm64/kernel/efi-header.S | 7 ------- > arch/arm64/kernel/setup.c | 4 ++-- > arch/arm64/kernel/vmlinux.lds.S | 2 +- > arch/arm64/mm/init.c | 2 +- > arch/arm64/mm/mmu.c | 10 +++++----- > 5 files changed, 9 insertions(+), 16 deletions(-) Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel