]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: spectre-v2: harden user aborts in kernel space
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 14 May 2018 13:20:21 +0000 (14:20 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Thu, 31 May 2018 09:40:32 +0000 (10:40 +0100)
commit84cf6ee69df2bf05ea58a6df85e1e682ce14aaf7
treec1a1264964eb0d9e6e4ed77ee2788139553108d6
parentb098d0aea981dc706ebd551c28220755e04bd7d9
ARM: spectre-v2: harden user aborts in kernel space

In order to prevent aliasing attacks on the branch predictor,
invalidate the BTB or instruction cache on CPUs that are known to be
affected when taking an abort on a address that is outside of a user
task limit:

Cortex A8, A9, A12, A17, A73, A75: flush BTB.
Cortex A15, Brahma B15: invalidate icache.

If the IBE bit is not set, then there is little point to enabling the
workaround.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Boot-tested-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
arch/arm/include/asm/cp15.h
arch/arm/include/asm/system_misc.h
arch/arm/mm/fault.c
arch/arm/mm/proc-v7-bugs.c
arch/arm/mm/proc-v7.S