From patchwork Fri Dec 8 11:13:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinbum Park X-Patchwork-Id: 10102347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9BF3D60360 for ; Fri, 8 Dec 2017 11:13:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E09828B4D for ; Fri, 8 Dec 2017 11:13:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 819C828B7C; Fri, 8 Dec 2017 11:13:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id B012C28B4D for ; Fri, 8 Dec 2017 11:13:40 +0000 (UTC) Received: (qmail 19615 invoked by uid 550); 8 Dec 2017 11:13:38 -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: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 19581 invoked from network); 8 Dec 2017 11:13:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=h5KAR/ihO5ZScJBOs50vKAOMem6YZyco6IJTOD8HHCs=; b=GbO8WgRQebpYTIWDsiupQwRzqVuH70Q/1Ck0mMfrs32aGviNG9LQ3UvpdDahAMfuZd RCCWjj03rE3DuyDX5ZdaeLxLEQMx0B2W219DGOugBEA0ShADg9wGRMtQWTamFLcMzD6f Q+anTte3DueElhkSJ1b/pn+QWRJG2GnZhyS53HvBYMNfdHHAJJRclyChH6KNlcr8JgHr ZXBzfGi4Txgc4td/voz1fr3T8bUzWHxuYa4rSPLBdX5FgHvWPPpnOJ9HxH0qyYEze9r4 siOaG4YlyOZvCDiB3jZ+oTaf1jN7J/2f+MkXcdZ47affgYzMxgFnPBt8wiJkOVRRxn3r wCRg== 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:mime-version :content-disposition:user-agent; bh=h5KAR/ihO5ZScJBOs50vKAOMem6YZyco6IJTOD8HHCs=; b=j/TjR+TbAXOp0mTsZKrj5nCpLOyM4igOWzzQ8Doc6Fz6ZZmsYy4uk5BASzqWtWgjND kbPBGueDmxwLRcvKpK+dFgbcBUA9PdHmJBdcIQBmVa1ztgrQdrwGIEPDpA3/41RROO0M 0BOOWbB5BFwIR0CxoVLkMTj/Fyhs6uoizUe/QjjXyOzEWbLlc6cVflVrFGqtDpy5P5yP bO2qlq4tS6FqPvVjoh4+cRYo2TmFDs5tz1zXT+eeGs5XyU1CpjAHQ0fJx/mLXISvuaTY Zk2oVEFKou3FdZzsDX4TqrtySKJ1g1rhZBTyYKg04HBKFGQkEMcnM+tG+z6uiBOyy3Qh NQ1A== X-Gm-Message-State: AJaThX4gJ4HcgrtfiurAXGp+0bMWwENGQN5TpYQL1LhK/eOXA3xyE82h ZYruYt97EsHJgTPpLbI8A+4= X-Google-Smtp-Source: AGs4zMZSTiFfMxvhbUNKODOj8We0rRBWA7PD8rYbrkt405Xf3tm5Yr7g4M9EDcTcgN2B8sVflLjPhQ== X-Received: by 10.84.149.139 with SMTP id m11mr29597360pla.36.1512731606279; Fri, 08 Dec 2017 03:13:26 -0800 (PST) Date: Fri, 8 Dec 2017 20:13:18 +0900 From: Jinbum Park To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Cc: linux@armlinux.org.uk, gregkh@linuxfoundation.org, tglx@linutronix.de, kstewart@linuxfoundation.org, mingo@kernel.org, pombredanne@nexb.com Message-ID: <20171208111318.GA12346@pjb1027-Latitude-E5410> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [kernel-hardening][PATCH] arm: mm: idmap: Mark variables as ro_after_init X-Virus-Scanned: ClamAV using ClamSMTP idmap_pgd, arch_phys_to_idmap_offset are setup once while init stage, and never changed after that. so, it is good candidate for __ro_after_init. Signed-off-by: Jinbum Park Reviewed-by: Kees Cook --- arch/arm/mm/idmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c index 10bfba8..1d1edd0 100644 --- a/arch/arm/mm/idmap.c +++ b/arch/arm/mm/idmap.c @@ -16,8 +16,8 @@ * are not supported on any CPU using the idmap tables as its current * page tables. */ -pgd_t *idmap_pgd; -long long arch_phys_to_idmap_offset; +pgd_t *idmap_pgd __ro_after_init; +long long arch_phys_to_idmap_offset __ro_after_init; #ifdef CONFIG_ARM_LPAE static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,