Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp39212pxb; Wed, 20 Oct 2021 16:02:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6SlGhAlYXwWS04BbY6Yd11PnpULEqfD/NW9H62CdrbYkB8ZAqzqppYUSjuSiVFWgKUwGz X-Received: by 2002:a17:90a:b381:: with SMTP id e1mr2128881pjr.55.1634770922903; Wed, 20 Oct 2021 16:02:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634770922; cv=none; d=google.com; s=arc-20160816; b=qmVTLl1wx6ap9GDMXb20/k1soHbM/fstJMJxP+1rdVUMzpgALH4fOiOdRQ0Y3YHVyb I0Uzmb2FPPLVFaG5fKQwl5T0x1XeHmeEb9yJLMS2HmJn+oAcdsgVMi+dw48+Vl3Wd6ru zH/zWprc1ZsLsiXLeH5HVI5k6KSpVlYJAHxGX08Xt4gktzSgbsD1pDtm7Isz/Hl9TUUB VJG0G8E0FiG7DZ33ye7Wciezm7I7BenNeg6UOWQjVokO/M/+c7wdXDw6H1lV0zVbkjEa /7olytUxymX1AP7NaIEYQyXK+ETwy2O7ldgp2ZfXmsguS1fTCdNEMhcJ8rOzJmZLRl+B ccCA== 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=h+RFC7eotFhOqFJGWOoMWVQg50r4LBG0z2sivzZSrgk=; b=dMWmBArFUgZ54PowfITs2os24Q8FTHhpapGilHJogg9iynDDgxCei0R5u1tBr3N+dh V+cjZkDdbVBKMdhYPS8VzG0pYbyeDE0Ren6VeSrYDXFLLJiRj0fQ2Vjz2CDhd4P1oAIX ywi4i6XIGgZxwJsr1nUWU32X21kgeJL5sJDX7Hx7ae3tU8csATixkR+5YelyMGpB1DIO LKrZJ2mgO909v1kuN5f1mic0y5P7bBHHgMW9fTW6bVJDMBnPJgIHPUK3MoEzNgkpq1sS qEUa+vL2see4coStYr0qwSRFCfrz00ZgGrhDA6pN1vSzVIRoJp6hd7geBHMcAofwbolc a+cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=pma9xTPA; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si2873869pls.176.2021.10.20.16.01.35; Wed, 20 Oct 2021 16:02:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=pma9xTPA; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230361AbhJTXDr (ORCPT + 99 others); Wed, 20 Oct 2021 19:03:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbhJTXDq (ORCPT ); Wed, 20 Oct 2021 19:03:46 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06B4CC06174E for ; Wed, 20 Oct 2021 16:01:32 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id kk10so3555406pjb.1 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=fcvHy7gzvkC/6hhx7eTnTgtutfzT0oWrU92Cp/7TCegKxRoH/q7s9nP+JpomCjxT8s jONPPb0scqdh4zuXhwLjVDQh1NXuKO3ov5ZShqacVCDBeC//rdKiQWdY1zpdhR7TV1i4 y/AMXX4C/IZ46vN84RbUIsTYMSt45NIoaqr50B1Qf7YJRGLg47ECql/IhyjTj65fY0gQ QjI9QJ6DxogA1cWbemzqyvPzQqI2+WSKRq4VqOgULSwzTe/aHuLdtFCWGMAEpQR8aMmM VKgxSoQlDUTR6if5x6YshooqpwHFFhkVz7rZJLazndPRvbCJ9LUcSDvXsPWNuvxEPdRa +nVA== X-Gm-Message-State: AOAM533DI0DIXpgQd1+ODnNOrBMDU6t9jUy93ad0jmeSkP7LPvSaSVou qR8h3L93b74F5RoABMaq6frYRQ== 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-crypto@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.