stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: mark.rutland@arm.com, alex.shi@linaro.org,
	catalin.marinas@arm.com, ghackmann@google.com,
	gregkh@linuxfoundation.org, jnair@caviumnetworks.com,
	will.deacon@arm.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "arm64: Turn on KPTI only on CPUs that need it" has been added to the 4.9-stable tree
Date: Thu, 05 Apr 2018 21:42:35 +0200	[thread overview]
Message-ID: <1522957355241145@kroah.com> (raw)
In-Reply-To: <20180403110923.43575-23-mark.rutland@arm.com>


This is a note to let you know that I've just added the patch titled

    arm64: Turn on KPTI only on CPUs that need it

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm64-turn-on-kpti-only-on-cpus-that-need-it.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Thu Apr  5 21:39:28 CEST 2018
From: Mark Rutland <mark.rutland@arm.com>
Date: Tue,  3 Apr 2018 12:09:18 +0100
Subject: arm64: Turn on KPTI only on CPUs that need it
To: stable@vger.kernel.org
Cc: mark.brown@linaro.org, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, will.deacon@arm.com
Message-ID: <20180403110923.43575-23-mark.rutland@arm.com>

From: Jayachandran C <jnair@caviumnetworks.com>

commit 0ba2e29c7fc1 upstream.

Whitelist Broadcom Vulcan/Cavium ThunderX2 processors in
unmap_kernel_at_el0(). These CPUs are not vulnerable to
CVE-2017-5754 and do not need KPTI when KASLR is off.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jayachandran C <jnair@caviumnetworks.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org> [v4.9 backport]
Signed-off-by: Mark Rutland <mark.rutland@arm.com> [v4.9 backport]
Tested-by: Will Deacon <will.deacon@arm.com>
Tested-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm64/kernel/cpufeature.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -766,6 +766,13 @@ static bool unmap_kernel_at_el0(const st
 	if (IS_ENABLED(CONFIG_RANDOMIZE_BASE))
 		return true;
 
+	/* Don't force KPTI for CPUs that are not vulnerable */
+	switch (read_cpuid_id() & MIDR_CPU_MODEL_MASK) {
+	case MIDR_CAVIUM_THUNDERX2:
+	case MIDR_BRCM_VULCAN:
+		return false;
+	}
+
 	/* Defer to CPU feature registers */
 	return !cpuid_feature_extract_unsigned_field(pfr0,
 						     ID_AA64PFR0_CSV3_SHIFT);


Patches currently in stable-queue which might be from mark.rutland@arm.com are

queue-4.9/arm64-mm-add-arm64_kernel_unmapped_at_el0-helper.patch
queue-4.9/arm64-entry-reword-comment-about-post_ttbr_update_workaround.patch
queue-4.9/arm64-kaslr-put-kernel-vectors-address-in-separate-data-page.patch
queue-4.9/arm64-turn-on-kpti-only-on-cpus-that-need-it.patch
queue-4.9/arm64-force-kpti-to-be-disabled-on-cavium-thunderx.patch
queue-4.9/arm64-mm-allocate-asids-in-pairs.patch
queue-4.9/arm64-tls-avoid-unconditional-zeroing-of-tpidrro_el0-for-native-tasks.patch
queue-4.9/arm64-use-ret-instruction-for-exiting-the-trampoline.patch
queue-4.9/arm64-entry-explicitly-pass-exception-level-to-kernel_ventry-macro.patch
queue-4.9/arm64-kpti-make-use-of-ng-dependent-on-arm64_kernel_unmapped_at_el0.patch
queue-4.9/arm64-mm-use-non-global-mappings-for-kernel-space.patch
queue-4.9/arm64-capabilities-handle-duplicate-entries-for-a-capability.patch
queue-4.9/arm64-entry-hook-up-entry-trampoline-to-exception-vectors.patch
queue-4.9/arm64-mm-invalidate-both-kernel-and-user-asids-when-performing-tlbi.patch
queue-4.9/arm64-mm-map-entry-trampoline-into-trampoline-and-kernel-page-tables.patch
queue-4.9/module-extend-rodata-off-boot-cmdline-parameter-to-module-mappings.patch
queue-4.9/arm64-kconfig-reword-unmap_kernel_at_el0-kconfig-entry.patch
queue-4.9/arm64-mm-move-asid-from-ttbr0-to-ttbr1.patch
queue-4.9/arm64-allow-checking-of-a-cpu-local-erratum.patch
queue-4.9/arm64-take-into-account-id_aa64pfr0_el1.csv3.patch
queue-4.9/arm64-kconfig-add-config_unmap_kernel_at_el0.patch
queue-4.9/arm64-idmap-use-awx-flags-for-.idmap.text-.pushsection-directives.patch
queue-4.9/arm64-factor-out-entry-stack-manipulation.patch
queue-4.9/arm64-entry-add-exception-trampoline-page-for-exceptions-from-el0.patch
queue-4.9/arm64-kpti-add-enable-callback-to-remap-swapper-using-ng-mappings.patch
queue-4.9/arm64-entry-add-fake-cpu-feature-for-unmapping-the-kernel-at-el0.patch
queue-4.9/arm64-cputype-add-midr-values-for-cavium-thunderx2-cpus.patch

  reply	other threads:[~2018-04-05 19:43 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03 11:08 [PATCH v4.9.y 00/27] arm64 meltdown patches Mark Rutland
2018-04-03 11:08 ` [PATCH v4.9.y 01/27] arm64: mm: Use non-global mappings for kernel space Mark Rutland
2018-04-05 19:42   ` Patch "arm64: mm: Use non-global mappings for kernel space" has been added to the 4.9-stable tree gregkh
2018-04-03 11:08 ` [PATCH v4.9.y 02/27] arm64: mm: Move ASID from TTBR0 to TTBR1 Mark Rutland
2018-04-05 19:42   ` Patch "arm64: mm: Move ASID from TTBR0 to TTBR1" has been added to the 4.9-stable tree gregkh
2018-04-03 11:08 ` [PATCH v4.9.y 03/27] arm64: mm: Allocate ASIDs in pairs Mark Rutland
2018-04-05 19:42   ` Patch "arm64: mm: Allocate ASIDs in pairs" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 04/27] arm64: mm: Add arm64_kernel_unmapped_at_el0 helper Mark Rutland
2018-04-05 19:42   ` Patch "arm64: mm: Add arm64_kernel_unmapped_at_el0 helper" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 05/27] arm64: mm: Invalidate both kernel and user ASIDs when performing TLBI Mark Rutland
2018-04-05 19:42   ` Patch "arm64: mm: Invalidate both kernel and user ASIDs when performing TLBI" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 06/27] arm64: factor out entry stack manipulation Mark Rutland
2018-04-05 19:42   ` Patch "arm64: factor out entry stack manipulation" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 07/27] module: extend 'rodata=off' boot cmdline parameter to module mappings Mark Rutland
2018-04-05 19:42   ` Patch "module: extend 'rodata=off' boot cmdline parameter to module mappings" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 08/27] arm64: entry: Add exception trampoline page for exceptions from EL0 Mark Rutland
2018-04-05 19:42   ` Patch "arm64: entry: Add exception trampoline page for exceptions from EL0" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 09/27] arm64: mm: Map entry trampoline into trampoline and kernel page tables Mark Rutland
2018-04-03 11:15   ` Mark Rutland
2018-04-05 19:33     ` Greg KH
2018-04-05 19:42   ` Patch "arm64: mm: Map entry trampoline into trampoline and kernel page tables" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 10/27] arm64: entry: Explicitly pass exception level to kernel_ventry macro Mark Rutland
2018-04-05 19:42   ` Patch "arm64: entry: Explicitly pass exception level to kernel_ventry macro" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 11/27] arm64: entry: Hook up entry trampoline to exception vectors Mark Rutland
2018-04-05 19:42   ` Patch "arm64: entry: Hook up entry trampoline to exception vectors" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 12/27] arm64: tls: Avoid unconditional zeroing of tpidrro_el0 for native tasks Mark Rutland
2018-04-05 19:42   ` Patch "arm64: tls: Avoid unconditional zeroing of tpidrro_el0 for native tasks" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 13/27] arm64: entry: Add fake CPU feature for unmapping the kernel at EL0 Mark Rutland
2018-04-05 19:42   ` Patch "arm64: entry: Add fake CPU feature for unmapping the kernel at EL0" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 14/27] arm64: kaslr: Put kernel vectors address in separate data page Mark Rutland
2018-04-05 19:42   ` Patch "arm64: kaslr: Put kernel vectors address in separate data page" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 15/27] arm64: use RET instruction for exiting the trampoline Mark Rutland
2018-04-05 19:42   ` Patch "arm64: use RET instruction for exiting the trampoline" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 16/27] arm64: Kconfig: Add CONFIG_UNMAP_KERNEL_AT_EL0 Mark Rutland
2018-04-05 19:42   ` Patch "arm64: Kconfig: Add CONFIG_UNMAP_KERNEL_AT_EL0" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 17/27] arm64: Kconfig: Reword UNMAP_KERNEL_AT_EL0 kconfig entry Mark Rutland
2018-04-05 19:42   ` Patch "arm64: Kconfig: Reword UNMAP_KERNEL_AT_EL0 kconfig entry" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 18/27] arm64: Take into account ID_AA64PFR0_EL1.CSV3 Mark Rutland
2018-04-05 19:42   ` Patch "arm64: Take into account ID_AA64PFR0_EL1.CSV3" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 19/27] arm64: Allow checking of a CPU-local erratum Mark Rutland
2018-04-05 19:42   ` Patch "arm64: Allow checking of a CPU-local erratum" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 20/27] arm64: capabilities: Handle duplicate entries for a capability Mark Rutland
2018-04-05 19:42   ` Patch "arm64: capabilities: Handle duplicate entries for a capability" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 21/27] arm64: cputype: Add MIDR values for Cavium ThunderX2 CPUs Mark Rutland
2018-04-05 19:42   ` Patch "arm64: cputype: Add MIDR values for Cavium ThunderX2 CPUs" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 22/27] arm64: Turn on KPTI only on CPUs that need it Mark Rutland
2018-04-05 19:42   ` gregkh [this message]
2018-04-03 11:09 ` [PATCH v4.9.y 23/27] arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0() Mark Rutland
2018-04-05 19:42   ` Patch "arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0()" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 24/27] arm64: kpti: Add ->enable callback to remap swapper using nG mappings Mark Rutland
2018-04-05 19:42   ` Patch "arm64: kpti: Add ->enable callback to remap swapper using nG mappings" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 25/27] arm64: Force KPTI to be disabled on Cavium ThunderX Mark Rutland
2018-04-05 19:42   ` Patch "arm64: Force KPTI to be disabled on Cavium ThunderX" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 26/27] arm64: entry: Reword comment about post_ttbr_update_workaround Mark Rutland
2018-04-05 19:42   ` Patch "arm64: entry: Reword comment about post_ttbr_update_workaround" has been added to the 4.9-stable tree gregkh
2018-04-03 11:09 ` [PATCH v4.9.y 27/27] arm64: idmap: Use "awx" flags for .idmap.text .pushsection directives Mark Rutland
2018-04-05 19:42   ` Patch "arm64: idmap: Use "awx" flags for .idmap.text .pushsection directives" has been added to the 4.9-stable tree gregkh
2018-04-04 15:07 ` [PATCH v4.9.y 00/27] arm64 meltdown patches Greg KH
2018-04-05 10:04   ` Will Deacon
2018-04-05 10:15     ` Mark Rutland
2018-04-05 11:46   ` Will Deacon
2018-04-05 17:34 ` Greg Hackmann
2018-04-05 19:15   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522957355241145@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alex.shi@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=ghackmann@google.com \
    --cc=jnair@caviumnetworks.com \
    --cc=mark.rutland@arm.com \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).