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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99438C433F5 for ; Wed, 20 Oct 2021 23:01:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F058611CE for ; Wed, 20 Oct 2021 23:01:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231286AbhJTXDu (ORCPT ); Wed, 20 Oct 2021 19:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbhJTXDq (ORCPT ); Wed, 20 Oct 2021 19:03:46 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0493C06161C for ; Wed, 20 Oct 2021 16:01:31 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id gn3so3573065pjb.0 for ; Wed, 20 Oct 2021 16:01:31 -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=h+RFC7eotFhOqFJGWOoMWVQg50r4LBG0z2sivzZSrgk=; b=pma9xTPAAozGlLfkB9sflNKGCaUTlYDPKd78LbYcHoBUpBRdiQpZNG/Cc1nZw9vI4s VTSD/474dW5dlNqhL8p1TXmulQIJQRdwQd35Hq/TvTJHLS+D754q5dwalnSMpnNallp6 QEE6REP3UMdDQd9t5/eTDAwqCT3kSq7TIRlSMz5dG+F3C0cAQG5Of9T0co/dFDVodtCw LDtGnlp14OoIc4w9aY2VNUN730bG1epxV1fC8y0RW9O5Yzg6agArEPev3CeYeo6QWUHe cjwF0FLqkskp8GARImJVl4T0BDlhURPzNIkeGgRFvjb/C72VmjO4rjSXV0a8d2SsN1L+ DK7g== 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=h+RFC7eotFhOqFJGWOoMWVQg50r4LBG0z2sivzZSrgk=; b=1VYfIaNoj+elDJSZXnSI7D0YpgrvtvIFw1nkUyD6teFc0OhSS3/TN9zKPlHKRxYv5Z 4Ku8vmSlkhaMV1w/AFXiR4i2c4jMgziQ7XHGCr8+sTERs3Ea5CPgG6rU33fdqngRCGBy VSFSQQWzhPK7arNR31HYJGMFfy62rEQ5Rn15rzdfTr/3r5p4/jRovdZv3V9xndFI510n YuULu+BKIJbw/T8RQSeQU2CXrnDikJBlCZlScJCDrRMHntrKUjRM9EV2Bg9QDNmIXscE n44vy6+z6CPTqN5u1W17XYlYP3Aw4m3YohCddcPI06MF8/nnbA3FfQyFy5mhOil8rD3S RcLw== X-Gm-Message-State: AOAM533VvgUTT7hGglL9bYM0kHGjEczkVzlvGYI7Ampc4tBfxxRNhb/B 6kVNwKzCVyZLs0/YbKT832sIgQ== X-Google-Smtp-Source: ABdhPJwAYmwtedqpowu2BAnkunIqrQX+jLSp7mbf/jJKomExPMM30rDS5HiPAzzKOhqXTZ7V/PFb/Q== X-Received: by 2002:a17:90a:b314:: with SMTP id d20mr2168217pjr.174.1634770891214; Wed, 20 Oct 2021 16:01:31 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id k1sm3356698pjj.54.2021.10.20.16.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 16:01:30 -0700 (PDT) Date: Wed, 20 Oct 2021 23:01:27 +0000 From: Sean Christopherson To: Brijesh Singh Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Borislav Petkov , Michael Roth , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH Part2 v5 44/45] KVM: SVM: Support SEV-SNP AP Creation NAE event Message-ID: References: <20210820155918.7518-1-brijesh.singh@amd.com> <20210820155918.7518-45-brijesh.singh@amd.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 Wed, Oct 20, 2021, Brijesh Singh wrote: > > On 10/15/21 2:50 PM, Sean Christopherson wrote: > > And digging through the guest patches, this gives the guest _full_ control over > > the VMSA contents. That is bonkers. At _best_ it gives the guest the ability to > > fuzz VMRUN ucode by stuffing garbage into the VMSA. > > If guest puts garbage in VMSA then VMRUN will fail. I am sure ucode is > doing all kind of sanity checks to ensure that VMSA does not contain > invalid value before the run. Oh, I'm well aware of the number of sanity checks that are in VM-Enter ucode, and that's precisely why I'm of the opinion that letting the guest fuzz VMRUN is a non-trivial security risk for the host. I know of at least at least two VMX bugs (one erratum that I could find, one that must have been fixed with a ucode patch?) where ucode failed to detect invalid state. Those were "benign" in that they caused a missed VM-Fail but didn't corrupt CPU state, but it's not a stretch to imagine a ucode bug that leads to corruption of CPU state and a system crash. The sheer number of checks involved, combined with the fact that there likely hasn't been much fuzzing of VM-Enter outside of the hardware vendor's own validation, means I'm not exactly brimming with confidence that VMRUN's ucode is perfect. I fully acknowledge that the host kernel obviously "trusts" CPU ucode to a great extent. My point here is that the design exposes the host to unnecessary risk.