Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2769710rwd; Fri, 16 Jun 2023 08:02:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7suomvHoSVeNcWiZN2A+cSuKlYiGbRwof9q/6slfcywdLedPP5PV2qiG1h2Rl1ig1T8ZLt X-Received: by 2002:a17:90a:2ec1:b0:25e:3841:1921 with SMTP id h1-20020a17090a2ec100b0025e38411921mr2131207pjs.20.1686927747623; Fri, 16 Jun 2023 08:02:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686927747; cv=none; d=google.com; s=arc-20160816; b=HuaWlVBaGdWqd5lxx+MFJh17ZIritYilis2iWKvoH/Hc39zEmvQi3vK9gSq+GUzVbi OvblqZmIQq1r16tVBthEUiptAUVotHJJOc4fKVoQ5R7S+eR/6MbmJsrzov3Uaf3bfPI4 KXHtbqTEDRmIy2hDMvWPm7RoRNZ77kHN7KadsAVIQt5DAF6jvgOC57cBGXDww7C7SGbu LZ8KOv1IB5KmXSNkIqFBHY4bh22xfFqggu5Lod++azRVJcgvvoQ6qElHURpivYKFBdiB 0jWGxPmft2FJl6LcfH363uEolbnYf8pmiEch+OnFAxbvNf7FXG3eWOWV6IJri/2l9cGl WIiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date:dkim-signature; bh=OsAZEJAZHUUDfMyKwjNpCmfGXNQVlottGvYSAOdxPyg=; b=mJ1UFCO66gSiIO3QcnhbO0Td1CEGe7xL4VTUOwkgeQZH/uX0LmuhAYYQHzUiaDvP07 BsEJFASPTt8u393IVOcELv308DAXCmg25VAKjJdEDNjOEt7Uq8BawV8HkCNC4+sVS/yC UlIMvniCRfpHCd4CTNKByM7b0XKKDRGm1hC54IcEQu7p249WpJseBvSFWxFYJIjiMj5L AY8023haX/ck7JrRtW2u7NGqBrPo8XAEHjrjn/JIYPzAGGl3N0orEbWg+zjRwVCavBWv DZU8WLbPeRyw+AmXqO4MvPr2sO41Gll8NV495K3XgpHr897ub0md0HQwHfh6Hbx3EnLb T9xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=adpwsG2H; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gp2-20020a17090adf0200b0025bd9dac5f1si1760073pjb.28.2023.06.16.08.02.04; Fri, 16 Jun 2023 08:02:27 -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=@google.com header.s=20221208 header.b=adpwsG2H; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229471AbjFPOmQ (ORCPT + 99 others); Fri, 16 Jun 2023 10:42:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjFPOmP (ORCPT ); Fri, 16 Jun 2023 10:42:15 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B90FA19B5 for ; Fri, 16 Jun 2023 07:42:13 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-bc97822915aso862868276.1 for ; Fri, 16 Jun 2023 07:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686926533; x=1689518533; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=OsAZEJAZHUUDfMyKwjNpCmfGXNQVlottGvYSAOdxPyg=; b=adpwsG2H6cpXugvKqirjGhwUIFMPDcrBNE0i5r4CFwEKGocnR4sJRF7wBs8wMBmquK B+M/fAOZqbFOi4HcCIIshkQ7WTG4l88FJE2SX4H8+BNDNA70XujEppAqcFuF+KSwr4Bo hARZWZADr2pxF2gdWzt1a5z+uKnqTBqWVuiSPd0uBNbkrLZ2CBXTMZz9qs/kzwhBQ8IK 3euvvKxfXe9uYn0RD9DOa27WKXJzrMVq01WfPol+DS9Svc0BwPl1Ezr//SlQh4PevOkh bTf6+6UNgkkF64pw9ZxpYCob2zIUbQUJkOLve05ZOVnUHp1UCoTUk6S6dKiiQdoMHYFS PRGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686926533; x=1689518533; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=OsAZEJAZHUUDfMyKwjNpCmfGXNQVlottGvYSAOdxPyg=; b=TA9DtIpQFYmmMs3qI6pVHV5JGxhQcgLYaUqALzKeGELcWTk4DNUf3Oid5YJ0tG4i6I UmtLfXh+zrc7QB8d7XPFu6DFWGlE5/9GWjhzIVKV2cVpOzBgHkLSABJHpk5ovNrr7vsJ Uo1bxqk+jPCMWpUxkQMIek+KGv07EIZnJ6zxU0lGKEsX2G8gEUqXkAjbbh+TWHbVsxAK QTQF+frMuZ+aNnygLcKlTUEdxkYauz7Zxp5ZqobIX9W3XrkhRMVNf+uF20aSs8/ItVrz gPDbzB+vVCjsHK76crtNPORWDzAXmR+yHx+s+VUaW2xur0x6sFv9vOAF8tYC2mvxyQb6 kESw== X-Gm-Message-State: AC+VfDxqQUadb6t8M7E0Xfs93Q54cN1RzNqRC9AAjrfaoyAsFBfSNoCo fxZsLKCzcJfivNwwLg2O94NdwlWXetg= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:951:0:b0:bcc:883f:ea2 with SMTP id u17-20020a250951000000b00bcc883f0ea2mr746955ybm.2.1686926532961; Fri, 16 Jun 2023 07:42:12 -0700 (PDT) Date: Fri, 16 Jun 2023 07:42:11 -0700 In-Reply-To: Mime-Version: 1.0 References: <20230612164727.3935657-1-carlos.bilbao@amd.com> <001aa2ed-2f78-4361-451d-e31a4d4abaa0@semihalf.com> Message-ID: Subject: Re: [PATCH v2] docs: security: Confidential computing intro and threat model for x86 virtualization From: Sean Christopherson To: Allen Webb Cc: Dmytro Maluka , Elena Reshetova , Carlos Bilbao , Jason CJ Chen , "corbet@lwn.net" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "ardb@kernel.org" , "kraxel@redhat.com" , "dovmurik@linux.ibm.com" , "dave.hansen@linux.intel.com" , "Dhaval.Giani@amd.com" , "michael.day@amd.com" , "pavankumar.paluri@amd.com" , "David.Kaplan@amd.com" , "Reshma.Lal@amd.com" , "Jeremy.Powell@amd.com" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "alexander.shishkin@linux.intel.com" , "thomas.lendacky@amd.com" , "tglx@linutronix.de" , "dgilbert@redhat.com" , "gregkh@linuxfoundation.org" , "dinechin@redhat.com" , "linux-coco@lists.linux.dev" , "berrange@redhat.com" , "mst@redhat.com" , "tytso@mit.edu" , "jikos@kernel.org" , "joro@8bytes.org" , "leon@kernel.org" , "richard.weinberger@gmail.com" , "lukas@wunner.de" , "jejb@linux.ibm.com" , "cdupontd@redhat.com" , "jasowang@redhat.com" , "sameo@rivosinc.com" , "bp@alien8.de" , "security@kernel.org" , Larry Dewey , android-kvm@google.com, Dmitry Torokhov , Tomasz Nowicki , Grzegorz Jaszczyk , Patryk Duda Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 Fri, Jun 16, 2023, Allen Webb wrote: > On Fri, Jun 16, 2023 at 8:56=E2=80=AFAM Sean Christopherson wrote: > > > > On Fri, Jun 16, 2023, Dmytro Maluka wrote: > > > On 6/14/23 16:15, Sean Christopherson wrote: > > > > On Wed, Jun 14, 2023, Elena Reshetova wrote: > > > >>>> +This new type of adversary may be viewed as a more powerful typ= e > > > >>>> +of external attacker, as it resides locally on the same physica= l machine > > > >>>> +-in contrast to a remote network attacker- and has control over= the guest > > > >>>> +kernel communication with most of the HW:: > > > >>> > > > >>> IIUC, this last statement doesn't hold true for the pKVM on x86 u= se case, which > > > >>> specifically aims to give a "guest" exclusive access to hardware = resources. > > > >> > > > >> Does it hold for *all* HW resources? If yes, indeed this would mak= e pKVM on > > > >> x86 considerably different. > > > > > > > > Heh, the original says "most", so it doesn't have to hold for all h= ardware resources, > > > > just a simple majority. > > > > > > Again, pedantic mode on, I find it difficult to agree with the wordin= g > > > that the guest owns "most of" the HW resources it uses. It controls t= he > > > data communication with its hardware device, but other resources (e.g= . > > > CPU time, interrupts, timers, PCI config space, ACPI) are owned by th= e > > > host and virtualized by it for the guest. > > > > I wasn't saying that the guest owns most resources, I was saying that t= he *untrusted* > > host does *not* own most resources that are exposed to the guest. My u= nderstanding > > is that everything in your list is owned by the trusted hypervisor in t= he pKVM model. > > > > What I was pointing out is related to the above discussion about the gu= est needing > > access to hardware that is effectively owned by the untrusted host, e.g= . network > > access. >=20 > The network case isn't a great example because it is common for user > space applications not to trust the network and to use verification > schemes like TLS where trust of the network is not required, so the > trusted guest could use these strategies when needed.=20 There's a bit of context/history that isn't captured here. The network bei= ng untrusted isn't new/novel in the SNP/TDX threat model, what's new is that t= he network *device* is untrusted. In the SNP/TDX world, the NIC is likely to be a synthetic, virtual device t= hat is provided by the untrusted VMM. Pre-SNP/TDX, input from the device, i.e. th= e VMM, is trusted; the guest still needs to use e.g. TLS to secure network traffic= , but the device configuration and whatnot is fully trusted. When the VMM is no = longer trusted, the device itself is no longer trusted. To address that, the folks working on SNP and TDX started posting patches[1= ][2] to harden kernel drivers against bad device configurations and whanot, but = without first getting community buy-in on this new threat model, which led us here[= 3]. There is no equivalent in existing userspace applications, because userspac= e's memory is not private, i.e. the kernel doesn't need to do Iago attacks to c= ompromise userspace, the kernel can simply read whatever memory it wants. And for pKVM, my understanding is that devices and configuration informatio= n that are exposed to the guest are trusted and/or verified in some way, i.e. the = points of contention that led to this doc don't necessarily apply to the pKVM use = case. [1] https://lore.kernel.org/linux-iommu/20210603004133.4079390-1-ak@linux.i= ntel.com [2] https://lore.kernel.org/all/20230119170633.40944-1-alexander.shishkin@l= inux.intel.com [3] https://lore.kernel.org/lkml/DM8PR11MB57505481B2FE79C3D56C9201E7CE9@DM8= PR11MB5750.namprd11.prod.outlook.com