Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp142225iob; Thu, 12 May 2022 21:08:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJGEW71OgjnniwGKdNnxD6cvXDZ8xXnbnU8XN9LplhIX+KqVTYkwidQd8pSosYQeGOmQQ9 X-Received: by 2002:a05:6402:908:b0:428:11f5:509d with SMTP id g8-20020a056402090800b0042811f5509dmr37578361edz.253.1652414915416; Thu, 12 May 2022 21:08:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652414915; cv=none; d=google.com; s=arc-20160816; b=vD+S2ZLDGhWP3EqCrjsjaBwKgF7S9h1YQ+uWCgPjWuScL/nZ4Yp0tGGEdkPN9ou305 TDLsiCN2gEmfCrsNQx55vFtiWFo8yowwR9iaMGKCBnJZi5tbdJbeocxYwvte4zhaWbW3 LXwCEuKPD9xqyg3skRWlArtjHzhcDUnBGQGhwNrnrGyFTAizc/3Ztcc8zWcxheADgC8z MQquRff/RzB/f+Tzhs6jIEovrqPrRG1E2K/W+/EYuoJMQqm49v4Y3tN2m0s6PksdnlLZ ek6Gi7FhTmqywB7TZZFYuxK4qVpcWajoX9baJBJaOIe/M2cGKThad/8vPujwHmcbkW1f 5LFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lPa7c9dHOHhN02kSSI97I/I6ysdJlQQ6rMlomVLCERk=; b=z47j28nQKXdZrHdD+b1YaYnZ0dcbBF4aevEpYTGpjzLZPpm4RYmGSjUClIS4n6ZZ88 A3WWoZEpRRE4p0tVG/InCpIxVWbbQb2h7WG4jvXuNveKJ7YDrG1kAZgGlNkNRo3R7jee lSACVQnX5Md36O6zSymT8G47LZyudD5pqnvwDRPSsP2Ner9kzATfShyMT/KrZps2qgt/ 9LeXPY/sDC8VhJUL0Ug6CifjcMXzFfsE1HB5+HR8vKYwLIjeEHB0NZBk7xyAO8sHozc/ 0D6265rbghh5AHnwnnS3+8m1UJHJXTQGgiscJm8z+Ixx3RawNA9yXCAyih2LSMpUTfm0 If/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=YpiYrIZy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c42-20020a509fad000000b00427acd290d2si851997edf.169.2022.05.12.21.08.09; Thu, 12 May 2022 21:08:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=YpiYrIZy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354567AbiELNop (ORCPT + 99 others); Thu, 12 May 2022 09:44:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354574AbiELNoj (ORCPT ); Thu, 12 May 2022 09:44:39 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C987248E36; Thu, 12 May 2022 06:44:37 -0700 (PDT) Received: from zn.tnic (p5de8eeb4.dip0.t-ipconnect.de [93.232.238.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C7E1B1EC06DA; Thu, 12 May 2022 15:44:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1652363071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=lPa7c9dHOHhN02kSSI97I/I6ysdJlQQ6rMlomVLCERk=; b=YpiYrIZyQx5NoGQ+fa+ZGRYPALgsEYRnvYQzOR7kwTe7p+yMa7bBgvE5/SF71E+fdAB1Sk jxMPlLLMyoMJthAGP4FvTQEc8uGEfIIOMoUmvBbXMOHt43tIxciJs1rGNhJE5/cIijH0p9 lAyx3JfL5RPHB/mtRr7Ir8IywoWI3bQ= Date: Thu, 12 May 2022 15:44:33 +0200 From: Borislav Petkov To: Sean Christopherson Cc: Jon Kohler , Thomas Gleixner , Ingo Molnar , Dave Hansen , "x86@kernel.org" , "H. Peter Anvin" , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Josh Poimboeuf , Peter Zijlstra , Balbir Singh , Kim Phillips , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , Andrea Arcangeli , Kees Cook , Waiman Long Subject: Re: [PATCH v3] x86/speculation, KVM: only IBPB for switch_mm_always_ibpb on vCPU load Message-ID: References: <4E46337F-79CB-4ADA-B8C0-009E7500EDF8@nutanix.com> <520D7CBE-55FA-4EB9-BC41-9E8D695334D1@nutanix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 10, 2022 at 03:50:31PM +0000, Sean Christopherson wrote: > > x86/speculation, KVM: remove IBPB on vCPU load > > > > Remove IBPB that is done on KVM vCPU load, as the guest-to-guest > > attack surface is already covered by switch_mm_irqs_off() -> > > cond_mitigation(). > > > > The original 15d45071523d ("KVM/x86: Add IBPB support") was simply wrong in > > its guest-to-guest design intention. There are three scenarios at play > > here: > > > > 1. If the vCPUs belong to the same VM, they are in the same security > > domain and do not need an IPBP. > > 2. If the vCPUs belong to different VMs, and each VM is in its own mm_struct, > > switch_mm_irqs_off() will handle IBPB as an mm switch is guaranteed to > > occur prior to loading a vCPU belonging to a different VMs. > > 3. If the vCPUs belong to different VMs, but multiple VMs share an mm_struct, > > then the security benefits of an IBPB when switching vCPUs are dubious, > > at best. > > > > Issuing IBPB from KVM vCPU load would only cover #3, but there are no > > Just to hedge, there are no _known_ use cases. > > > real world tangible use cases for such a configuration. > > and I would further qualify this with: > > but there are no known real world, tangible use cases for running multiple > VMs belonging to different security domains in a shared address space. > > Running multiple VMs in a single address space is plausible and sane, _if_ they > are all in the same security domain or security is not a concern. That way the > statement isn't invalidated if someone pops up with a use case for running multiple > VMs but has no security story. > > Other than that, LGTM. > > > If multiple VMs > > are sharing an mm_structs, prediction attacks are the least of their > > security worries. > > > > Fixes: 15d45071523d ("KVM/x86: Add IBPB support") > > (Reviewedby/signed of by people here) > > (Code change simply whacks IBPB in KVM vmx/svm and thats it) I agree with all that I've read so far - the only thing that's missing is: (Documentation in Documentation/admin-guide/hw-vuln/spectre.rst about what the use cases are and what we're protecting against and what we're *not* protecting against because ). Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette