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:22:32 +0000 (12:22 +0100)
commit842f2d498ee1e75fc9bf78555ee5b59c894c071b
tree648f27b88e97ad53b9c2ed1541dece575ffff2d3
parent576548846f1ee53a4d04fa5f91e6a088adbfe3f8
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