From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61729C04E84 for ; Thu, 16 May 2019 17:43:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 31B592070D for ; Thu, 16 May 2019 17:43:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728894AbfEPRnQ (ORCPT ); Thu, 16 May 2019 13:43:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbfEPRnQ (ORCPT ); Thu, 16 May 2019 13:43:16 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 966D830043F8; Thu, 16 May 2019 17:43:15 +0000 (UTC) Received: from treble (ovpn-120-91.rdu2.redhat.com [10.10.120.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A8C2608A6; Thu, 16 May 2019 17:43:14 +0000 (UTC) Date: Thu, 16 May 2019 12:43:12 -0500 From: Josh Poimboeuf To: Geert Uytterhoeven Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Jiri Kosina , Greg Kroah-Hartman , Ben Hutchings , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] cpu/speculation: Warn on unsupported mitigations= parameter Message-ID: <20190516174312.f3ipwv4io4tnulnn@treble> References: <20190516070935.22546-1-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190516070935.22546-1-geert@linux-m68k.org> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 16 May 2019 17:43:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 16, 2019 at 09:09:35AM +0200, Geert Uytterhoeven wrote: > Currently, if the user specifies an unsupported mitigation strategy on > the kernel command line, it will be ignored silently. The code will > fall back to the default strategy, possibly leaving the system more > vulnerable than expected. > > This may happen due to e.g. a simple typo, or, for a stable kernel > release, because not all mitigation strategies have been backported. > > Inform the user by printing a message. > > Fixes: 98af8452945c5565 ("cpu/speculation: Add 'mitigations=' cmdline option") > Cc: stable@vger.kernel.org > Signed-off-by: Geert Uytterhoeven > --- > kernel/cpu.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/kernel/cpu.c b/kernel/cpu.c > index f2ef10460698e9ec..8458fda00e6ddb88 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -2339,6 +2339,9 @@ static int __init mitigations_parse_cmdline(char *arg) > cpu_mitigations = CPU_MITIGATIONS_AUTO; > else if (!strcmp(arg, "auto,nosmt")) > cpu_mitigations = CPU_MITIGATIONS_AUTO_NOSMT; > + else > + pr_crit("Unsupported mitigations=%s, system may still be vulnerable\n", > + arg); > > return 0; > } > -- > 2.17.1 > Acked-by: Josh Poimboeuf -- Josh