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 1fFpUG-0000KJ-AO for speck@linutronix.de; Tue, 08 May 2018 01:24:08 +0200 From: Dave Hansen Subject: [MODERATED] [PATCH 3/5] SSB extra v2 3 Date: Mon, 7 May 2018 16:18:44 -0700 Message-Id: =?utf-8?q?=3C15a559407274841456857d4b9c732c68aac52537=2E152573?= =?utf-8?q?4796=2Egit=2Edave=2Ehansen=40intel=2Ecom=3E?= In-Reply-To: References: In-Reply-To: References: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 To: speck@linutronix.de Cc: Dave Hansen List-ID: From: Dave Hansen When calling other programs, assume that those programs are not trusted and mark the current program as needing mitigation. This situation can obviously be improved by checking the calling program to see if it needs mitigation. That step is left as an exercise to the reader (the folks who have actually looked at the BPF code for more than two days in their life). Signed-off-by: Dave Hansen --- kernel/bpf/verifier.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 5dd1dcb..ee454b6 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -5481,6 +5481,8 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env) * the program array. */ prog->cb_access = 1; + prog->need_mitigation = 1; + env->prog->aux->stack_depth = MAX_BPF_STACK; /* mark bpf_tail_call as different opcode to avoid -- 2.9.5