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 09:13:31 +0000 (10:13 +0100)
commite01553f4048027183dc480ada93dc34b5d056a42
tree61a184d04484ccf63f5ddb8869e3e73b0b61bc2d
parentcf32c1579d50f1e26970557bc68b365d0ae10a89
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