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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 18463C5B57D for ; Tue, 2 Jul 2019 08:10:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E60F62184B for ; Tue, 2 Jul 2019 08:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562055047; bh=uiVFToY1J/8BCI8bn4gOJQPAGV7k0Xk67iP/xnWd0VE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QYKt4hEf4IUbcjQYwKBtUxiN9kMcqPQp8fU5B/z0SRWZvJgcHjo2oMOzxQPA7Xu0L pg1XMAwGvFaKwkO9vG7hdUoG08FABMzabWSY34VC5bV0P8zmZ+v/aoKtBGKCRILpqX rUA5A228knt95YSFGit7NXCTWGI443CbdYh4PlGY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728884AbfGBIKp (ORCPT ); Tue, 2 Jul 2019 04:10:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:59534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728879AbfGBIKn (ORCPT ); Tue, 2 Jul 2019 04:10:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B7F020665; Tue, 2 Jul 2019 08:10:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562055042; bh=uiVFToY1J/8BCI8bn4gOJQPAGV7k0Xk67iP/xnWd0VE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ikkpbzuqCU+wY+k1wthotoAWo098xdDbDYda3Tvi5BrD09iGBiCkyk95kSgemAk3j nheHOXQGkvyP3ImJ65DDkzpsUYoFDwO1QTW/yZ2QdVBSOOB+IdWsmqEXe24TdDR9Xw yQmHk+Hn95vckwdy/6nadwarrRjW3IWrYCrGOFsE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Thomas Gleixner , Josh Poimboeuf , Peter Zijlstra , Jiri Kosina , Ben Hutchings Subject: [PATCH 4.14 25/43] cpu/speculation: Warn on unsupported mitigations= parameter Date: Tue, 2 Jul 2019 10:02:05 +0200 Message-Id: <20190702080125.137325770@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190702080123.904399496@linuxfoundation.org> References: <20190702080123.904399496@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven commit 1bf72720281770162c87990697eae1ba2f1d917a upstream. 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") Signed-off-by: Geert Uytterhoeven Signed-off-by: Thomas Gleixner Acked-by: Josh Poimboeuf Cc: Peter Zijlstra Cc: Jiri Kosina Cc: Greg Kroah-Hartman Cc: Ben Hutchings Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20190516070935.22546-1-geert@linux-m68k.org Signed-off-by: Greg Kroah-Hartman --- kernel/cpu.c | 3 +++ 1 file changed, 3 insertions(+) --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -2308,6 +2308,9 @@ static int __init mitigations_parse_cmdl 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; }