]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ARM: spectre-v2: harden user aborts in kernel space
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 15 Oct 2018 15:32:02 +0000 (11:32 -0400)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:53:56 +0000 (19:53 -0600)
commit6499689500ffb0be02c525a9c2e4c5fce3291ab1
treea9417de7a24a0082843f88eb3aa1b378cedd2499
parent785cfcf62300895c7c63128743da7061d89de2ff
ARM: spectre-v2: harden user aborts in kernel space

BugLink: https://bugs.launchpad.net/bugs/1836426
Commit f5fe12b1eaee220ce62ff9afb8b90929c396595f upstream.

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>
Signed-off-by: David A. Long <dave.long@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.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