Return-path: Received: from mta.outflux.net ([2001:19d0:2:6:c0de:0:736d:7471] helo=smtp.outflux.net) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fEe2Q-0007x0-Uh for speck@linutronix.de; Fri, 04 May 2018 18:58:31 +0200 Received: from www.outflux.net (serenity.outflux.net [10.2.0.2]) by vinyl.outflux.net (8.15.2/8.15.2/Debian-3) with ESMTP id w44GwNbL023337 for ; Fri, 4 May 2018 09:58:23 -0700 Date: Fri, 4 May 2018 09:58:23 -0700 From: Kees Cook Subject: [MODERATED] Re: [patch 6/6] SSB update 6 Message-ID: <20180504165823.GI6017@outflux.net> References: <20180504132317.028193533@linutronix.de> <20180504132336.015689246@linutronix.de> MIME-Version: 1.0 In-Reply-To: <20180504132336.015689246@linutronix.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Fri, May 04, 2018 at 03:23:23PM +0200, speck for Thomas Gleixner wrote: > Subject: [patch 6/6] x86/speculation: Make "seccomp" the default mode for Speculative Store Bypass > From: Kees Cook > > Unless explicitly opted out of, anything running under seccomp will have > SSB mitigations enabled. Choosing the "prctl" mode will disable this. > > [ tglx: Adjusted it to the new arch_seccomp_spec_mitigate() mechanism ] It looks like the following hunk got missed when adjusting my earlier patch: diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 993a572dc06a..686847b00a20 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -599,6 +607,7 @@ static int ssb_prctl_get(struct task_struct *task) switch (ssb_mode) { case SPEC_STORE_BYPASS_DISABLE: return PR_SPEC_DISABLE; + case SPEC_STORE_BYPASS_SECCOMP: case SPEC_STORE_BYPASS_PRCTL: if (task_spec_force_disable(task)) return PR_SPEC_PRCTL | PR_SPEC_FORCE_DISABLE; And this might be useful to fix later uses of pr_*: diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 993a572dc06a..686847b00a20 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -540,6 +542,7 @@ static void ssb_select_mitigation() } #undef pr_fmt +#define pr_fmt(fmt) "Speculation prctl: " fmt static int ssb_prctl_set(struct task_struct *task, unsigned long ctrl) { -- Kees Cook @outflux.net