]> www.infradead.org Git - users/hch/misc.git/commit
arm64: bpf: Add BHB mitigation to the epilogue for cBPF programs
authorJames Morse <james.morse@arm.com>
Thu, 9 Dec 2021 15:13:24 +0000 (15:13 +0000)
committerJames Morse <james.morse@arm.com>
Thu, 8 May 2025 14:28:35 +0000 (15:28 +0100)
commit0dfefc2ea2f29ced2416017d7e5b1253a54c2735
tree46fac081ffc5f13e4c0560e4f17a694296d420cf
parenta1152be30a043d2d4dcb1683415f328bf3c51978
arm64: bpf: Add BHB mitigation to the epilogue for cBPF programs

A malicious BPF program may manipulate the branch history to influence
what the hardware speculates will happen next.

On exit from a BPF program, emit the BHB mititgation sequence.

This is only applied for 'classic' cBPF programs that are loaded by
seccomp.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
arch/arm64/include/asm/spectre.h
arch/arm64/kernel/proton-pack.c
arch/arm64/net/bpf_jit_comp.c