Message ID | 20201104215702.GG24993@redhat.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | RFC: default to spec_store_bypass_disable=prctl spectre_v2_user=prctl | expand |
On Wed, Nov 04, 2020 at 04:57:02PM -0500, Andrea Arcangeli wrote: > Switch the kernel default of SSBD and STIBP to the ones with > CONFIG_SECCOMP=n (i.e. spec_store_bypass_disable=prctl > spectre_v2_user=prctl) even if CONFIG_SECCOMP=y. Agreed. I think this is the right time to flip this switch. I agree with the (very well described) rationales. :) Fundamentally, likely everyone who is interested in manipulating the mitigations are doing so now, and it doesn't make sense (on many fronts) to tie some to seccomp mode any more (which was intended as a temporary defense to gain coverage while sysadmins absorbed what the best practices should be). Thanks for sending this! Acked-by: Kees Cook <keescook@chromium.org>
On Wed, Nov 04 2020 at 16:57, Andrea Arcangeli wrote: > --- > Documentation/admin-guide/kernel-parameters.txt | 5 ++--- Is Documentation/admin-guide/hw-vuln/* still correct? If not, please fix that as well. Aside of that please send patches in the proper format so they do not need manual interaction when picking them up. Thanks, tglx
On Thu, Nov 05, 2020 at 12:22:29AM +0100, Thomas Gleixner wrote: > On Wed, Nov 04 2020 at 16:57, Andrea Arcangeli wrote: > > --- > > Documentation/admin-guide/kernel-parameters.txt | 5 ++--- > > Is Documentation/admin-guide/hw-vuln/* still correct? If not, please > fix that as well. Right, I missed two seccomp mention that needed removing there too. Also I noticed below I intended PR_SPEC_INDIRECT_BRANCH (PR_SPEC_STORE_BYPASS there is no point to even mention it as a possibility to be considered), so I corrected it. == uses no JIT. If sshd prefers to keep doing the STIBP window dressing exercise, it still can even after this change of defaults by opting-in with PR_SPEC_STORE_BYPASS. == > > >with PR_SPEC_INDIRECT_BRANCH. > Aside of that please send patches in the proper format so they do not > need manual interaction when picking them up. This was a RFC per subject since I expected it wouldn't be final, but I added Kees' Acked-by and I'll submit it now. Thanks, Andrea
Is anything happening with this proposal? Is there anything I could do to help it along? My personal motivation is that I'm involved in developing and using the [Shadow] simulator, which we use to run hours and days long simulations. We're currently looking into running some simulations in gitlab CI Docker runner to take advantage of shared hardware, but Docker currently doesn't expose a way to opt out of these mitigations without turning off seccomp altogether [Docker FR]. I've measured these mitigations to cause simulations to take 50% longer [Overhead], so I'm pretty motivated to find a way to disable them :). [Shadow]: https://shadow.github.io/ [Docker FR]: https://github.com/moby/moby/issues/42619 [Overhead]: https://github.com/shadow/shadow/issues/1489#issuecomment-871445482 P.S. Attempting to respond to a thread without actually being subscribed to the list; sorry if this ends up not threading correctly. The CC header was truncated so also some original recipients have been dropped. Original thread: https://lkml.org/lkml/2020/11/4/1135
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 526d65d8573a..105401a3582f 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -4980,8 +4980,7 @@ auto - Kernel selects the mitigation depending on the available CPU features and vulnerability. - Default mitigation: - If CONFIG_SECCOMP=y then "seccomp", otherwise "prctl" + Default mitigation: "prctl" Not specifying this option is equivalent to spectre_v2_user=auto. @@ -5025,7 +5024,7 @@ will disable SSB unless they explicitly opt out. Default mitigations: - X86: If CONFIG_SECCOMP=y "seccomp", otherwise "prctl" + X86: "prctl" On powerpc the options are: diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index d3f0db463f96..5ec39397fe9c 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -721,11 +721,11 @@ spectre_v2_user_select_mitigation(enum spectre_v2_mitigation_cmd v2_cmd) case SPECTRE_V2_USER_CMD_FORCE: mode = SPECTRE_V2_USER_STRICT; break; + case SPECTRE_V2_USER_CMD_AUTO: case SPECTRE_V2_USER_CMD_PRCTL: case SPECTRE_V2_USER_CMD_PRCTL_IBPB: mode = SPECTRE_V2_USER_PRCTL; break; - case SPECTRE_V2_USER_CMD_AUTO: case SPECTRE_V2_USER_CMD_SECCOMP: case SPECTRE_V2_USER_CMD_SECCOMP_IBPB: if (IS_ENABLED(CONFIG_SECCOMP)) @@ -1132,7 +1132,6 @@ static enum ssb_mitigation __init __ssb_select_mitigation(void) return mode; switch (cmd) { - case SPEC_STORE_BYPASS_CMD_AUTO: case SPEC_STORE_BYPASS_CMD_SECCOMP: /* * Choose prctl+seccomp as the default mode if seccomp is @@ -1146,6 +1145,7 @@ static enum ssb_mitigation __init __ssb_select_mitigation(void) case SPEC_STORE_BYPASS_CMD_ON: mode = SPEC_STORE_BYPASS_DISABLE; break; + case SPEC_STORE_BYPASS_CMD_AUTO: case SPEC_STORE_BYPASS_CMD_PRCTL: mode = SPEC_STORE_BYPASS_PRCTL; break;