From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mga07.intel.com ([134.134.136.100]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fFpUE-0000KE-U2 for speck@linutronix.de; Tue, 08 May 2018 01:24:07 +0200 From: Dave Hansen Subject: [MODERATED] [PATCH 0/5] SSB extra v2 0 Date: Mon, 7 May 2018 16:18:41 -0700 Message-Id: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 To: speck@linutronix.de Cc: Dave Hansen List-ID: 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