linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM branch predictor hardening
@ 2018-01-06 12:09 Marc Zyngier
  2018-01-06 12:09 ` [PATCH 1/3] arm: Add BTB invalidation on switch_mm for Cortex-A9, A12, A15 and A17 Marc Zyngier
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Marc Zyngier @ 2018-01-06 12:09 UTC (permalink / raw)
  To: linux-arm-kernel

This small series implements some basic BP hardening by invalidating
the BTB on CPUs that are known to be susceptible to aliasing attacks.

These patches are closely modelled against what we do on arm64,
although simpler as we can rely on an architected instruction to
perform the invalidation.

The first patch reuses the Cortex-A8 BTB invalidation in switch_mm and
generalises it to be used on all affected CPUs. The second perform the
same invalidation on fatal signal delivery. The last one nukes it on
guest exit, and results in some major surgery (kudos to Dimitris
Papastamos who came up with the magic vector decoding sequence).

Note that that M-class CPUs are not affected and for R-class cores,
the mitigation doesn't make much sense since we do not enforce
user/kernel isolation.

Marc Zyngier (3):
  arm: Add BTB invalidation on switch_mm for Cortex-A9, A12, A15 and A17
  arm: Invalidate BTB on fatal signal for Cortex A8, A9, A12, A15 and
    A17
  arm: KVM: Invalidate BTB on guest exit

 arch/arm/include/asm/cp15.h  |  2 ++
 arch/arm/kvm/hyp/hyp-entry.S | 74 +++++++++++++++++++++++++++++++++++++-------
 arch/arm/mm/fault.c          | 11 +++++++
 arch/arm/mm/proc-v7-2level.S |  4 +--
 arch/arm/mm/proc-v7-3level.S |  6 ++++
 arch/arm/mm/proc-v7.S        | 32 +++++++++----------
 6 files changed, 100 insertions(+), 29 deletions(-)

-- 
2.14.2

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-01-10 16:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-06 12:09 [PATCH 0/3] ARM branch predictor hardening Marc Zyngier
2018-01-06 12:09 ` [PATCH 1/3] arm: Add BTB invalidation on switch_mm for Cortex-A9, A12, A15 and A17 Marc Zyngier
2018-01-06 18:48   ` [PATCH 1/2] ARM: Add BTB invalidation on switch_mm for Brahma-B15 Florian Fainelli
2018-01-08 14:29   ` [PATCH 1/3] arm: Add BTB invalidation on switch_mm for Cortex-A9, A12, A15 and A17 Andre Przywara
2018-01-08 14:46     ` Marc Zyngier
2018-01-08 17:50       ` Robin Murphy
2018-01-06 12:09 ` [PATCH 2/3] arm: Invalidate BTB on fatal signal for Cortex A8, A9, " Marc Zyngier
2018-01-06 18:49   ` [PATCH 2/2] ARM: Invalidate BTB on fatal signal for Brahma-B15 Florian Fainelli
2018-01-06 12:09 ` [PATCH 3/3] arm: KVM: Invalidate BTB on guest exit Marc Zyngier
2018-01-06 13:27   ` Ard Biesheuvel
2018-01-06 13:39     ` Marc Zyngier
2018-01-06 13:35   ` Ard Biesheuvel
2018-01-06 13:55     ` Marc Zyngier
2018-01-06 18:50 ` [PATCH 0/3] ARM branch predictor hardening Florian Fainelli
2018-01-08 21:28   ` Marc Zyngier
2018-01-10 16:57     ` Russell King - ARM Linux
2018-01-08 16:54 ` Tony Lindgren
2018-01-08 17:02   ` Marc Zyngier
2018-01-08 17:24     ` Tony Lindgren
2018-01-08 17:30       ` Marc Zyngier

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).