x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting
authorJosh Poimboeuf <jpoimboe@redhat.com>
Fri, 18 Feb 2022 19:49:08 +0000 (11:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Mar 2022 11:22:31 +0000 (12:22 +0100)
commit316e4a16524a2d2ce321f57c1abe4df9ef90f950
treebd1e2dac5cbc0ca90f6244ae3c5dcc76c654cf2d
parenteb459641775636c3b4382ecc43ba3d6aa16892d5
x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting

commit 44a3918c8245ab10c6c9719dd12e7a8d291980d8 upstream.

With unprivileged eBPF enabled, eIBRS (without retpoline) is vulnerable
to Spectre v2 BHB-based attacks.

When both are enabled, print a warning message and report it in the
'spectre_v2' sysfs vulnerabilities file.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
[fllinden@amazon.com: backported to 5.15]
Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/cpu/bugs.c
include/linux/bpf.h
kernel/sysctl.c