Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp537181pxj; Thu, 3 Jun 2021 12:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSAFpokpXPA+bZkRg/Xq7cMDADoTkYBerpWAlRfBQmFBhahhVrQpYa1f/1p7Qt+rO9IpEh X-Received: by 2002:a17:906:3395:: with SMTP id v21mr893283eja.102.1622750122527; Thu, 03 Jun 2021 12:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622750122; cv=none; d=google.com; s=arc-20160816; b=YaBOQXAOLFnmKPAqzUm50s2q/ovO8sjofWfg+ZqAA3oI9dSPIEvLvd1i3eVDUyiucM vPXjJM3jEMd4oZJcf1ZyeAxXUzMEHjqjGEFfT4qSPRrit3qXbw15GyhBArihbuaZSc9w LF4DYbRJdZ5ZIBOP1PEEd5HOVTSObMGDxbD5rXSSWpj2Z1L7lMgHXRH/jwmkptQ4+inI 5MnxqaJ8CRSkaZLRPwntE+D+eaugsidtOuLxETYgd8F861XtznuGrSdNTBV/3y8rvmVN RYDJPGG/mjwvVxi49wlw5hyZY5p6hMJ/JifUP3SxARN9sDJ4eIQ66+Vf1wqnTVYpugqA 3qJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=RIVX7jxgkWLYJ7f34XupEfxTFiwJJ5MkYN/ayhosy64=; b=w30pp/SCDA704OMx7Ui6boYS001mw6EyBGwnlFmac1ilitVrSfhP0b3qY1QGvp+hdF kBYx2Ji4MmkaUKf1pfNMyRY49/cIpxe3WAkAUwXGRS/zm6RD8MvuCSsv/lh0TYuiqLxf 4Oh+wnalrAQtIzd6pIjgDv3yyLD6OlxkwXUVdKpS/dZ/bBSLWSPenZb6wFc8UsiZeNd3 pdXWbS9YpjDt0E+bFowlQMs49BZZdOCs5dZwK4/sTht989DCFWNSCjRkePazid0Zjpt3 9j3BO89pLpaWye80uvYlacpCIx9FqObufYO4w/5hcAKeP6bbg+vga5w+UhxbK7ERU4YU AOvg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v29si2804214ejk.374.2021.06.03.12.54.57; Thu, 03 Jun 2021 12:55:22 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229656AbhFCTzt (ORCPT + 99 others); Thu, 3 Jun 2021 15:55:49 -0400 Received: from mga17.intel.com ([192.55.52.151]:45226 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhFCTzs (ORCPT ); Thu, 3 Jun 2021 15:55:48 -0400 IronPort-SDR: cNWS7CAQAEfPotZtFLpnSONR1pv3JNA3uD6UIgIfBcYVYSK11r4LBYQ9VHgn9gHbqNl7A3lh0O HyfDijBCgxYA== X-IronPort-AV: E=McAfee;i="6200,9189,10004"; a="184507803" X-IronPort-AV: E=Sophos;i="5.83,246,1616482800"; d="scan'208";a="184507803" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2021 12:53:45 -0700 IronPort-SDR: j796NHDs2Zozxq/wBHEuvMXvyPgtLyCvrhm5igEiL3IiR3qXnYzpqEuyF5uad7fplBhS/dqAsL 5gvTbni69t6A== X-IronPort-AV: E=Sophos;i="5.83,246,1616482800"; d="scan'208";a="550819682" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.209.7.237]) ([10.209.7.237]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2021 12:53:44 -0700 Subject: Re: [PATCH v1 1/8] virtio: Force only split mode with protected guest To: Andy Lutomirski , mst@redhat.com Cc: jasowang@redhat.com, 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 References: <20210603004133.4079390-1-ak@linux.intel.com> <20210603004133.4079390-2-ak@linux.intel.com> <2b2dec75-a0c1-4013-ac49-a49f30d5ac3c@www.fastmail.com> From: Andi Kleen Message-ID: <3159e1f4-77cd-e071-b6f2-a2bb83cfc69a@linux.intel.com> Date: Thu, 3 Jun 2021 12:53:43 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <2b2dec75-a0c1-4013-ac49-a49f30d5ac3c@www.fastmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Tell that to every crypto downgrade attack ever. That's exactly what this patch addresses. > > I see two credible solutions: > > 1. Actually harden the virtio driver. That's exactly what this patchkit, and the alternative approaches, like 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. In most use cases the legacy driver is not insecure because there is no memory protection anyways. Yes maybe such a split would be a good idea for maintenance and maybe performance reasons, but at least from the security perspective I don't see any need for it. > > Another snag you may hit: virtio’s heuristic for whether to use proper DMA ops or to bypass them is a giant kludge. I’m very slightly optimistic that getting the heuristic wrong will make the driver fail to operate but won’t allow the host to take over the guest, but I’m not really convinced. And I wrote that code! A virtio-modern mode probably should not have a heuristic, and the various iommu-bypassing modes should be fixed to work at the bus level, not the device level TDX and SEV use the arch hook to enforce DMA API, so that part is also solved. -Andi