Received: by 10.223.185.116 with SMTP id b49csp2305054wrg; Thu, 15 Feb 2018 09:32:50 -0800 (PST) X-Google-Smtp-Source: AH8x224IRAjmYoPx3rQ07hRYWTVc/0LYtKXw7BSqcnIDj5MoP88kz7WI/991ZvEeJbqwRmqJLdip X-Received: by 10.101.75.11 with SMTP id r11mr2820394pgq.36.1518715969974; Thu, 15 Feb 2018 09:32:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518715969; cv=none; d=google.com; s=arc-20160816; b=Th4WzAliM9Odc6G5Q4mNrxTctYfv/AQWPks9xFZfCsVLkzp0kidK2QJxo270AQAOFb 4lmnXUWWqVNsyhjpBU2pthu5gTEvAdNnVb3Scv1J6eVTDNPGNCTU6bVToAwpTYr6A3z8 pb356v2+pM7Tq3iAy4bD9NXrB1DkWqL53ROnArb5Dhh05Pat8QILAlSCZZws3ZEVRSSC FaCciiDoTuF2QeY9bO7GwDmYXjJYQoE0di3jOnqSGPdB4zhuOzjd68zHfD1YxJ8T3Ms+ nf3s6SiuxYEG7fWYQaPOROFaMs791WgNdjN5lB2gka4ug5FU3e34DRJinK9apYjA93n3 2jbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=AQ1BAuFHaAC71IWd5duUqBGWigWkmdfPG/tLchEWiwM=; b=JuWzHEtk+rmQ1abXIMTakpIYtGb09r9um48W1F/ovAVByAW7ShwUFDoWf7I6Dll1WA JNuqZjbEzzqSlydOgZJq6kA+JWfKlbN89nuvtGxloLRDyOq/sgieJe24YuCoBhYnmMH3 HKT/wlnIJc7hpmdiFR6vX27KYUmZBU7XSZH9PtgtRNOWt3Imyh6urQDPIBm1e4u0yukm B73/TLvysYcG/hpQC7GcJRFKrAcYLryjJa8KKMmccZoZj9RSFNxZPbeRTEPJcJxEOJF4 KBrmh2YJaeUbC334J75zJvnC1r7GadTd0/pYEnMcC6ncJbLo5a/Q+8sHblMppUov+5ms oV+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si1274239pgd.335.2018.02.15.09.32.35; Thu, 15 Feb 2018 09:32:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164927AbeBOPdk (ORCPT + 99 others); Thu, 15 Feb 2018 10:33:40 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:56788 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164915AbeBOPdh (ORCPT ); Thu, 15 Feb 2018 10:33:37 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A1E5210D2; Thu, 15 Feb 2018 15:33:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier , Will Deacon , Catalin Marinas , Ard Biesheuvel Subject: [PATCH 4.14 055/195] [Variant 3/Meltdown] arm64: idmap: Use "awx" flags for .idmap.text .pushsection directives Date: Thu, 15 Feb 2018 16:15:46 +0100 Message-Id: <20180215151708.484383036@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151705.738773577@linuxfoundation.org> References: <20180215151705.738773577@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Will Deacon Commit 439e70e27a51 upstream. The identity map is mapped as both writeable and executable by the SWAPPER_MM_MMUFLAGS and this is relied upon by the kpti code to manage a synchronisation flag. Update the .pushsection flags to reflect the actual mapping attributes. Reported-by: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Ard Biesheuvel Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpu-reset.S | 2 +- arch/arm64/kernel/head.S | 2 +- arch/arm64/kernel/sleep.S | 2 +- arch/arm64/mm/proc.S | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) --- a/arch/arm64/kernel/cpu-reset.S +++ b/arch/arm64/kernel/cpu-reset.S @@ -16,7 +16,7 @@ #include .text -.pushsection .idmap.text, "ax" +.pushsection .idmap.text, "awx" /* * __cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2) - Helper for --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -371,7 +371,7 @@ ENDPROC(__primary_switched) * end early head section, begin head code that is also used for * hotplug and needs to have the same protections as the text region */ - .section ".idmap.text","ax" + .section ".idmap.text","awx" ENTRY(kimage_vaddr) .quad _text - TEXT_OFFSET --- a/arch/arm64/kernel/sleep.S +++ b/arch/arm64/kernel/sleep.S @@ -96,7 +96,7 @@ ENTRY(__cpu_suspend_enter) ret ENDPROC(__cpu_suspend_enter) - .pushsection ".idmap.text", "ax" + .pushsection ".idmap.text", "awx" ENTRY(cpu_resume) bl el2_setup // if in EL2 drop to EL1 cleanly bl __cpu_setup --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -86,7 +86,7 @@ ENDPROC(cpu_do_suspend) * * x0: Address of context pointer */ - .pushsection ".idmap.text", "ax" + .pushsection ".idmap.text", "awx" ENTRY(cpu_do_resume) ldp x2, x3, [x0] ldp x4, x5, [x0, #16] @@ -152,7 +152,7 @@ ENTRY(cpu_do_switch_mm) ret ENDPROC(cpu_do_switch_mm) - .pushsection ".idmap.text", "ax" + .pushsection ".idmap.text", "awx" .macro __idmap_cpu_set_reserved_ttbr1, tmp1, tmp2 adrp \tmp1, empty_zero_page @@ -185,7 +185,7 @@ ENDPROC(idmap_cpu_replace_ttbr1) .popsection #ifdef CONFIG_UNMAP_KERNEL_AT_EL0 - .pushsection ".idmap.text", "ax" + .pushsection ".idmap.text", "awx" .macro __idmap_kpti_get_pgtable_ent, type dc cvac, cur_\()\type\()p // Ensure any existing dirty @@ -373,7 +373,7 @@ ENDPROC(idmap_kpti_install_ng_mappings) * Initialise the processor for turning the MMU on. Return in x0 the * value of the SCTLR_EL1 register. */ - .pushsection ".idmap.text", "ax" + .pushsection ".idmap.text", "awx" ENTRY(__cpu_setup) tlbi vmalle1 // Invalidate local TLB dsb nsh