Commit cb0321f0 authored by Tyler Hicks's avatar Tyler Hicks Committed by Kleber Sacilotto de Souza

Revert "UBUNTU: SAUCE: bpf: Use barrier_nospec() instead of osb()"

This reverts commit 5b9ee259 which was
part of an out-of-tree mitigation for CVE-2017-5753 (Spectre variant 1),
in the BPF subsystem, that was available at the time of the coordinated
release date. The Ubuntu kernel has since rebased on top of newer
linux-stable releases and picked up commit b2157399 ("bpf: prevent
out-of-bounds speculation") which is upstream's mitigation of Spectre
variant 1 in the BPF code.

CVE-2017-5753
Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent f0fe227f
......@@ -27,9 +27,9 @@
#include <linux/random.h>
#include <linux/moduleloader.h>
#include <linux/bpf.h>
#include <linux/nospec.h>
#include <asm/unaligned.h>
#include <asm/barrier.h>
/* Registers */
#define BPF_R0 regs[BPF_REG_0]
......@@ -632,7 +632,7 @@ static unsigned int __bpf_prog_run(void *ctx, const struct bpf_insn *insn)
DST = IMM;
CONT;
LD_IMM_DW:
barrier_nospec();
osb();
DST = (u64) (u32) insn[0].imm | ((u64) (u32) insn[1].imm) << 32;
insn++;
CONT;
......@@ -847,7 +847,7 @@ static unsigned int __bpf_prog_run(void *ctx, const struct bpf_insn *insn)
*(SIZE *)(unsigned long) (DST + insn->off) = IMM; \
CONT; \
LDX_MEM_##SIZEOP: \
barrier_nospec(); \
osb(); \
DST = *(SIZE *)(unsigned long) (SRC + insn->off); \
CONT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment