]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
x86, bpf, jit: prevent speculative execution when JIT is enabled
authorElena Reshetova <elena.reshetova@intel.com>
Tue, 8 Aug 2017 09:06:58 +0000 (12:06 +0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 5 Feb 2018 15:55:58 +0000 (16:55 +0100)
commite75582dd101fbf69940e724ca916180809ea6918
treea4c1fece4a6c1e95fc0d4fa6a58227836010de65
parente567ef42925108a4a2bae1279052f5d0a33d180f
x86, bpf, jit: prevent speculative execution when JIT is enabled

CVE-2017-5753 (Spectre v1 Intel)

When constant blinding is enabled (bpf_jit_harden = 1), this adds
an observable speculation barrier before emitting x86 jitted code
for the BPF_ALU(64)_OR_X and BPF_ALU_LHS_X
(for BPF_REG_AX register) eBPF instructions. This is needed in order
to prevent speculative execution on out of bounds BPF_MAP array
indexes when JIT is enabled. This way an arbitary kernel memory is
not exposed through side-channel attacks.

Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/x86/net/bpf_jit_comp.c
include/linux/filter.h