All of lore.kernel.org
 help / color / mirror / Atom feed
* [MODERATED] [PATCH 0/5] SSB extra v2 0
@ 2018-05-07 23:18 Dave Hansen
  2018-05-07 23:18 ` [MODERATED] [PATCH 1/5] SSB extra v2 1 Dave Hansen
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Dave Hansen @ 2018-05-07 23:18 UTC (permalink / raw)
  To: speck; +Cc: Dave Hansen

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(-)

-- 
2.9.5

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-05-16 15:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-07 23:18 [MODERATED] [PATCH 0/5] SSB extra v2 0 Dave Hansen
2018-05-07 23:18 ` [MODERATED] [PATCH 1/5] SSB extra v2 1 Dave Hansen
2018-05-07 23:18 ` [MODERATED] [PATCH 2/5] SSB extra v2 2 Dave Hansen
2018-05-07 23:18 ` [MODERATED] [PATCH 3/5] SSB extra v2 3 Dave Hansen
2018-05-07 23:18 ` [MODERATED] [PATCH 4/5] SSB extra v2 4 Dave Hansen
2018-05-07 23:18 ` [MODERATED] [PATCH 5/5] SSB extra v2 5 Dave Hansen
2018-05-08  0:36 ` [MODERATED] " Andi Kleen
2018-05-08  0:46   ` Dave Hansen
2018-05-09 15:36     ` Thomas Gleixner
2018-05-09 15:43       ` [MODERATED] " Dave Hansen
2018-05-09 15:55         ` Greg KH
2018-05-09 16:03           ` Dave Hansen
2018-05-09 16:05             ` Jiri Kosina
2018-05-09 16:36               ` Dave Hansen
2018-05-16 15:23                 ` Jon Masters
2018-05-09 21:04         ` Linus Torvalds

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.