Received: by 10.213.65.68 with SMTP id h4csp707663imn; Fri, 6 Apr 2018 07:36:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx49LXRmBneB0NUjxHB9ET8pV40p/4SkXHNNTB79WSxjeH24RHFMAapZgPIbjDYvpZuA5J9u/ X-Received: by 2002:a17:902:7b8e:: with SMTP id w14-v6mr13595679pll.52.1523025409454; Fri, 06 Apr 2018 07:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523025409; cv=none; d=google.com; s=arc-20160816; b=Vcz8rbhNPVvF6cWgEG8esHlfrsKsJYj44A/ZPmz2zPtPjV08VHt3mEHmOiuGYag6go 6eM4CcqJrlizWaNQ8kDARC83oO37rOsO1xFRUtY2QOxrNWk+9nfWNJNceux+LuKHcgfW GldM2TiC7bzjcmQ5nIhHlGmtA2EzBIQdqypEX42fx2vOcvG9PQfML10zs9poGu8vzwGe QcdOq6A6+ByzvNekWFS8iblr94OCOea9ErxqZHkfYax1Sfr2NIA8f11JJjYXWw9BPAXj lxZxbs0Fuo727gVIFeG4gVvaB3FZNZXk6bKn4e9sxuS8pRZcPusvMjDlGSAeFkTaW8YO od0w== 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=ABEQTcy/EF4hsCthXGVVH5FGsY6gZPQtG/rYRFw51iE=; b=J//fAGJhhM5bFAQlbKxcSUf46rJuMF42FZtEA3u3i8iL2RK7EKdwZ462O2ZmsDEWjN y9atpODs/YDmQRNRng7PI0KuH4xn/9pBPq4saUw7Hy3x8kcMvi3/X8hUPpVVSLYRJYCk MxSrSNeCcGjzGdlb7iYYmhdbpb96pAPhhgGJbhEORJwt8cQTEJK9W+sqotehbxCk+80u b81kQAYYYH5JYN985H3glwdrf7dC5OuaVhiJHo1niJxAEzK0U7xwF9kjDfLN8lWHE8Gv oJ9w03NJh15VUIz9RPXSPr2S+CxszB0THu6IeWjgb49+yXELhAI5qwwObHUuo493c/dz f+nA== 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 x3-v6si8761465plo.479.2018.04.06.07.36.35; Fri, 06 Apr 2018 07:36:49 -0700 (PDT) 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 S1756099AbeDFOfe (ORCPT + 99 others); Fri, 6 Apr 2018 10:35:34 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58958 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755828AbeDFNfp (ORCPT ); Fri, 6 Apr 2018 09:35:45 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 57674DCB; Fri, 6 Apr 2018 13:35:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Marc Zyngier , Will Deacon , Catalin Marinas , Greg Hackmann , Alex Shi , Mark Rutland Subject: [PATCH 4.9 076/102] arm64: idmap: Use "awx" flags for .idmap.text .pushsection directives Date: Fri, 6 Apr 2018 15:23:57 +0200 Message-Id: <20180406084342.245532564@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.9-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: Alex Shi [v4.9 backport] Signed-off-by: Mark Rutland [v4.9 backport] Tested-by: Will Deacon Tested-by: Greg Hackmann 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 @@ -473,7 +473,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 @@ -95,7 +95,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 @@ -83,7 +83,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] @@ -147,7 +147,7 @@ alternative_else_nop_endif 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 @@ -180,7 +180,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 @@ -368,7 +368,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