Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp621728pxj; Thu, 3 Jun 2021 15:19:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD2vXAbRIbbwk0/Khu+gtgQFeariJtNYoVvMV3nl31L6arNdZ8EOOTk5Sfm68n8VS2Royr X-Received: by 2002:a17:906:49c8:: with SMTP id w8mr1274027ejv.497.1622758768011; Thu, 03 Jun 2021 15:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622758768; cv=none; d=google.com; s=arc-20160816; b=z9PPtev/X3Co5CON66L0xMOJbgGSp0Su9cUa8r4F7d98VnApvhrZOvGlnxHrW9vcyO 4jRyB+M9+bRvEHw12xL8E9ned2tqGbCXwTSIiFClKOLVAtTES3+XjSycKUh3RGO5ewZI 56DTzXrxSWGC4Y1xBPkesdwVg/p+m5b/hGuO90JF61/dY+YZ8c4AyLAAe2ETkL3uU31y txVB6Oz96b9vZBhGlqBu6o0fU+xqQytdRtkYUHxiG3PpvPPo7nMwc1Sgk/ocdm/RvtRt hCSvHhTVctD7Kw1US4FBgGqvYPVv3XP/NBxPYfgDv5kBOlrLEzLz6G9zVQ5WfF2+k1WQ fTsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :dkim-signature; bh=1No7bDtcM55penCKf3+oO4J8dA1BfIYWJfXldt6eC3k=; b=mhOtmj+oMbsO3glGPmkgjN66h6QHfANkL1Q3bRowciWz8RNh0TXB8Ba+B1DVB2Q5TP +skVfACzn8+l89pAqjwGda+5orOr5tD5lX6yhIY3YHcr8bmZGJo/VtAPGMvNWSDPUpnZ n1RFOzHvAaCpxu1OaRxsWaqJsT0MB5P0eS7vATOhDqtgJDHEWVzl2i2F67YCq/laKxxZ O9aZXMKTGI3/2SNH1gEtdfe4SnTYRSBD6SWQHrtY4WKB2cgBD8wXNrXMOdAF5nUGMc2n PujmSEv9O6Ek3KOeCiK8ybz2kmNKOcqQsdmrArMrRtITeNYn0xB4y2HW7xFbK/3Ljfjz roFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=goelUiYe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si3043785ejd.630.2021.06.03.15.19.03; Thu, 03 Jun 2021 15:19:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b=goelUiYe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230083AbhFCWTq (ORCPT + 99 others); Thu, 3 Jun 2021 18:19:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:57766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhFCWTp (ORCPT ); Thu, 3 Jun 2021 18:19:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 16EAB613DA; Thu, 3 Jun 2021 22:17:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622758680; bh=iBpJa3hzL2XnQctU7nWWRQdmYnS2ODgfQmpUYL+CSCM=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=goelUiYeT6Jd2Jmn9BB/fItRWSNuABe7n2yK6Y+YJPyGwSX01/AthAUxdUNw+ZBdH SuI8LPItlruF68n+9wr3nEQOW+uYYfMZUBYrszZFMo2SmLpAk8GsqKT6u9BCvL11Bx uZRMvXJkNTJy06TL1KjRejiWcrQTNBFDUfs9Zi/gTSEIUsYx/6eh4Ij5+RUQIixemD 8jHtfO2OfqpJi80x/AB6iHrf1XMwdrpN45cVP45y32uyXpkv1FDCf/r1uQ6I/oKpzI JJzK1yHiXw0s9MbQP0YbtwS4NlzJGdQzA5XkVHJkSGL/5RlC9hrb7xq8AbMJeGvGFG NLxrgQsCUFDhQ== Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailauth.nyi.internal (Postfix) with ESMTP id 1243527C005B; Thu, 3 Jun 2021 18:17:58 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute2.internal (MEProxy); Thu, 03 Jun 2021 18:17:58 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedttddgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedftehn ugihucfnuhhtohhmihhrshhkihdfuceolhhuthhosehkvghrnhgvlhdrohhrgheqnecugg ftrfgrthhtvghrnhepvdelheejjeevhfdutdeggefftdejtdffgeevteehvdfgjeeiveei ueefveeuvdetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheprghnugihodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudeiudek heeifedvqddvieefudeiiedtkedqlhhuthhopeepkhgvrhhnvghlrdhorhhgsehlihhnuh igrdhluhhtohdruhhs X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id F0C3351C0060; Thu, 3 Jun 2021 18:17:56 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-519-g27a961944e-fm-20210531.001-g27a96194 Mime-Version: 1.0 Message-Id: In-Reply-To: <3159e1f4-77cd-e071-b6f2-a2bb83cfc69a@linux.intel.com> References: <20210603004133.4079390-1-ak@linux.intel.com> <20210603004133.4079390-2-ak@linux.intel.com> <2b2dec75-a0c1-4013-ac49-a49f30d5ac3c@www.fastmail.com> <3159e1f4-77cd-e071-b6f2-a2bb83cfc69a@linux.intel.com> Date: Thu, 03 Jun 2021 15:17:34 -0700 From: "Andy Lutomirski" To: "Andi Kleen" , mst@redhat.com Cc: "Jason Wang" , virtualization@lists.linux-foundation.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, iommu@lists.linux-foundation.org, "the arch/x86 maintainers" , sathyanarayanan.kuppuswamy@linux.intel.com, "Josh Poimboeuf" , "Linux Kernel Mailing List" Subject: Re: [PATCH v1 1/8] virtio: Force only split mode with protected guest Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 3, 2021, at 12:53 PM, Andi Kleen wrote: >=20 > > Tell that to every crypto downgrade attack ever. >=20 > That's exactly what this patch addresses. >=20 > > > > I see two credible solutions: > > > > 1. Actually harden the virtio driver. > That's exactly what this patchkit, and the alternative approaches, lik= e=20 > Jason's, are doing. > > > > 2. Have a new virtio-modern driver and use it for modern use cases. = Maybe rename the old driver virtio-legacy or virtio-insecure. They can = share code. >=20 > In most use cases the legacy driver is not insecure because there is n= o=20 > memory protection anyways. >=20 > Yes maybe such a split would be a good idea for maintenance and maybe=20= > performance reasons, but at least from the security perspective I don'= t=20 > see any need for it. Please reread my email. We do not need an increasing pile of kludges to make TDX and SEV =E2=80=9C= secure=E2=80=9D. We need the actual loaded driver to be secure. The vi= rtio architecture is full of legacy nonsense, and there is no good reaso= n for SEV and TDX to be a giant special case. As I said before, real PCIe (Thunderbolt/USB-C or anything else) has the= exact same problem. The fact that TDX has encrypted memory is, at best= , a poor proxy for the actual condition. The actual condition is that t= he host does not trust the device to implement the virtio protocol corre= ctly. >=20 > > > > Another snag you may hit: virtio=E2=80=99s heuristic for whether to = use proper DMA ops or to bypass them is a giant kludge. I=E2=80=99m very= slightly optimistic that getting the heuristic wrong will make the driv= er fail to operate but won=E2=80=99t allow the host to take over the gue= st, but I=E2=80=99m not really convinced. And I wrote that code! A virt= io-modern mode probably should not have a heuristic, and the various iom= mu-bypassing modes should be fixed to work at the bus level, not the dev= ice level >=20 > TDX and SEV use the arch hook to enforce DMA API, so that part is also= =20 > solved. >=20 Can you point me to the code you=E2=80=99re referring to? >=20 > -Andi >=20 >=20