Skip to content

SSB extra v2 0

Dave Hansen historical-speck 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5SSB extra v2 1include/linux/nospec.h kernel/bpf/core.c+9 -00 replies
2/5SSB extra v2 2include/linux/filter.h kernel/bpf/core.c net/core/filter.c+40 -10 replies
3/5SSB extra v2 3kernel/bpf/verifier.c+2 -00 replies
4/5SSB extra v2 4kernel/bpf/syscall.c+2 -00 replies
5/5SSB extra v2 5include/linux/bpf_verifier.h kernel/bpf/syscall.c kernel/bpf/verifier.c+12 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [MODERATED] [PATCH 0/5] SSB extra v2 0

This is still highly RFC. I would mostly like feedback from folks as to whether the overall method of plugging into BPF is more acceptable now. This has not been tested on real hardware yet.

--

BPF is a potential source of gadgets that can be used for memory diambiguation-based attacks. To help mitigate these, we enable the bit in SPEC_CTRL which enables the reduced (memory) speculation mode on the processor when runing BPF code.

This improves on the last version quite a bit: there is no overhead for unmitigated BPF programs. Instead of calling the mitigation code unconditionally, we stick it in a wrapper function which then calls the real BPF payload. In the unmitigated case, the function pointer just points to the payload directly.

This also does not do any of the arch-specific bits. Thomas has some code to do that.

Big caveat: I've only been looking at BPF for a couple of days. I'm not deepy familiar with the code and I'm positive there are bugs and tons of ways to optimize this.

Thomas Gleixner(1):
bpf: Add speculation control interface

Dave Hansen (4):
bpf: install mitigation wrapper for untrusted programs
bpf: set prog->need_mitigation when calling other programs
bpf: populate prog->need_mitigation for unprivileged programs
bpf: only mitigate programs that write to memory

 include/linux/bpf_verifier.h |  1 +
 include/linux/filter.h       |  7 ++++++-
 include/linux/nospec.h       |  4 ++++
 kernel/bpf/core.c            | 14 ++++++++++++++
 kernel/bpf/verifier.c        | 13 +++++++++++++
 net/core/filter.c            | 25 +++++++++++++++++++++++++
 6 files changed, 63 insertions(+), 1 deletion(-)
Signature · 1 line
2.9.5