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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 22AC6C433EF for ; Fri, 10 Sep 2021 17:55:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08DAE611CB for ; Fri, 10 Sep 2021 17:55:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232000AbhIJR4m (ORCPT ); Fri, 10 Sep 2021 13:56:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbhIJR4i (ORCPT ); Fri, 10 Sep 2021 13:56:38 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0169C061574 for ; Fri, 10 Sep 2021 10:55:27 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id n4so1627523plh.9 for ; Fri, 10 Sep 2021 10:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=74br1N0NBz3VAESrVPeVqbSv4KpvlUpZC5wb7BVH5bM=; b=PoMBT5PzZXpKtCxjsX/Fld3niyqTFQTJjrnbjxl22WWNvHGWfD3bdB0IiukTT5/T2m U5lyc00oHBvpOWjq2DGox4Cctkd4i6lRb2SoWvoH5pcIQEfkorPNdRgbzBmfmntSWKXV 7iX1e/se+bux8EjhtPtfZ79ou55zlTOSM8B4FbWY1tDIwbmFhmY5xq05r0kfOOBllEQ6 PLrpL4zQM89JZ8dNbS/NiOFb7fXms/Tp39FzOijmzTOmvd09isUJ8+S6rEOt17UD+xsL XtrUs17yUp+CTl+sP2ZrsAb8C1wzaPBcc84g1KC0c8pL6nz+BZ+P4/VOTsSSlJzhwrwH 8/Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=74br1N0NBz3VAESrVPeVqbSv4KpvlUpZC5wb7BVH5bM=; b=0Obv7oSDRvqE9rr31BdbekC2Ril3l30nW40lQYLvrVciwVTveMOGHGWWu+uDy6zLZB lCdwoiOpOyaLT7yWlkU1Sn2Qa7vLOKgBCByVpyS49cojVs2ki54McuVqmk/rxWoO5/2f vvJuAXh+tcwk4H8pisg4+KkLWMbIjCCUufg9aMasjaFKSu2iNaIH+1Vxc8XSgoR/0oc6 FjpI/erCo1P14+nSqYShx7aEsqlNxSfMxhbjnsIKX8ZSgtf9pmCEGuaZJ/7SgWF1fGAf ZhdumfkhhZonuXcov8M2m+wLNRSpfoIOdgiidj2Ms5JOdYnv+1nieQvvIPYQcEucLXJy Pstg== X-Gm-Message-State: AOAM530NzinhBP7PN+WEJ1HHDElOnB/YxeYAb/qNylrWrgeD6nlAtV3u JpiEk2ZU83mOAZrAFsTOjWjCFA== X-Google-Smtp-Source: ABdhPJx+wMohUP/daiNsbnsj/P33eYsOJ6z7uBSLf55XZZ3IuD7jQEyqiAzTKGYWyEzS0McFfWHsVA== X-Received: by 2002:a17:902:ea11:b0:13a:db38:cfcf with SMTP id s17-20020a170902ea1100b0013adb38cfcfmr4790469plg.3.1631296527096; Fri, 10 Sep 2021 10:55:27 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id b17sm5635774pfo.98.2021.09.10.10.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Sep 2021 10:55:26 -0700 (PDT) Date: Fri, 10 Sep 2021 17:55:22 +0000 From: Sean Christopherson To: Xiaoyao Li Cc: Chenyi Qiang , Tao Xu , pbonzini@redhat.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] KVM: VMX: Enable Notify VM exit Message-ID: References: <20210525051204.1480610-1-tao3.xu@intel.com> <080602dc-f998-ec13-ddf9-42902aa477de@intel.com> <4079f0c9-e34c-c034-853a-b26908a58182@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021, Xiaoyao Li wrote: > On 9/10/2021 2:47 AM, Sean Christopherson wrote: > > On Tue, Sep 07, 2021, Xiaoyao Li wrote: > > > On 9/3/2021 12:29 AM, Sean Christopherson wrote: > > > > > After syncing internally, we know that the internal threshold is not > > > > > architectural but a model-specific value. It will be published in some place > > > > > in future. > > > > > > > > Any chance it will also be discoverable, e.g. via an MSR? > > > > > > I also hope we can expose it via MSR. If not, we can maintain a table per > > > FMS in KVM to get the internal threshold. However, per FMS info is not > > > friendly to be virtualized (when we are going to enable the nested support). > > > > Yeah, FMS is awful. If the built-in buffer isn't discoverable, my vote is to > > assume the worst, i.e. a built-in buffer of '0', and have the notify_window > > param default to a safe value, e.g. 25k or maybe even 150k (to go above what the > > hardware folks apparently deemed safe for SPR). It's obviously not idea, but > > it's better than playing FMS guessing games. > > > > > I'll try to persuade internal to expose it via MSR, but I guarantee nothing. > > > > ... > > > > > > On a related topic, this needs tests. One thought would be to stop unconditionally > > > > intercepting #AC if NOTIFY_WINDOW is enabled, and then have the test set up the > > > > infinite #AC vectoring scenario. > > > > > > > > > > yes, we have already tested with this case with notify_window set to 0. No > > > false positive. > > > > Can you send a selftest or kvm-unit-test? > > > > Actually we implement the attacking case of CVE-2015-5307 with > kvm-unit-test, while manually disabling the intercept of #AC. > > First, it requires modification of KVM that only posting the kvm-unit-test > doesn't help. It helps in that hacking KVM to disable #AC interception is a lot easier than re-writing a test from scratch. > Second, release the attacking case is not the correct action. As in it's irresponsible to provide code that can be used to DoS a hypervisor? The CVE is six years old, IMO security-through-obscurity is unnecessary at this point.