ARM: include unprivileged BPF status in Spectre V2 reporting
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 7 Mar 2022 19:28:32 +0000 (19:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Mar 2022 11:11:50 +0000 (12:11 +0100)
commit302754d023a06171113e8fb20c7b2a18ebf9088f
treea1de533419f28bc2013de86081e739731da902e5
parent3f9c958e3572b19b1cfb9d28eeb15be0a5d80193
ARM: include unprivileged BPF status in Spectre V2 reporting

commit 25875aa71dfefd1959f07e626c4d285b88b27ac2 upstream.

The mitigations for Spectre-BHB are only applied when an exception
is taken, but when unprivileged BPF is enabled, userspace can
load BPF programs that can be used to exploit the problem.

When unprivileged BPF is enabled, report the vulnerable status via
the spectre_v2 sysfs file.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kernel/spectre.c