Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2124857pxb; Sat, 2 Oct 2021 07:26:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzC5RDMK/jChg9DHWj4UCJfQeDC7MbSjD/WPcCHfrRTvjBXtMi3kvtRZJ7UZzQx0QbxEnL X-Received: by 2002:a65:6392:: with SMTP id h18mr3019568pgv.397.1633184775150; Sat, 02 Oct 2021 07:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633184775; cv=none; d=google.com; s=arc-20160816; b=r3ytAv34DBqML4k0TLdx2brK18FJQkiAfOBJYip1JsLHLYu68nXXYRNqHSb4gYYtkv XRmhzWvkvlQA+REZ9aPfP3JxWjnDt9AI2tqHzqrqsNKirQ+pf5Ulk5vss/fnqzNQclAg SF6aaXtyPs5iw6EwXa9vmgoazXht3zR+sX5UBzjLyTlhlwV1SS35vvvzvenAFRyXY8n5 1hri69pJ87w/L5Y3ktmo7B2XLmZ+ip/djdFqUOJl15lzzY6KqmaxekCboHu5maJnTgd7 Jt8rGnjFGH4osq1+RYUbjDnhATABzxMU6LZuZtNBImYBm2NVL56Ay/uejlAKPXnhw55n x2yQ== 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; bh=dpk/ukMA9Tk0snELdXw6c/1KIdkc+Qy1Q+WJBA9IKPE=; b=wOBRDsu8PvlQYqXSkxTVq7d7DZQ8E6pJ3Nwb0mqzE7tHVp8GrMFH3dKCy+VAGtR8P6 XX1mmGM/8vskdws+4KhhofPzzDYDrEnaG9x+eU6Z3G5g5S9rg+6KwhQA83YRREJVPKeJ WGtaDBR5oUGjj9k3yNs+7keZp9mghNguhcKYPAEyaufKikh5q5GPbHcN+s3slKECM4E8 fUa5XwVeaBw2LT2sQLTHrb/vKXq36jms3X8QYKML1MSoQKzK1dlKeszcFt3lr2avjkVZ r6L/qHugbkZSWHaPXF+afb2vbUjKZEL4Qbi+jR/fXy3wwCeLzueqhuGsVWJag8gZs+yC BlHQ== 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 z7si11214367pgv.624.2021.10.02.07.26.01; Sat, 02 Oct 2021 07:26:15 -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 S233371AbhJBOWN (ORCPT + 99 others); Sat, 2 Oct 2021 10:22:13 -0400 Received: from mga17.intel.com ([192.55.52.151]:27557 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233274AbhJBOWK (ORCPT ); Sat, 2 Oct 2021 10:22:10 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10125"; a="205845445" X-IronPort-AV: E=Sophos;i="5.85,341,1624345200"; d="scan'208";a="205845445" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2021 07:20:24 -0700 X-IronPort-AV: E=Sophos;i="5.85,341,1624345200"; d="scan'208";a="565773947" Received: from unknown (HELO [10.134.107.90]) ([10.134.107.90]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2021 07:20:23 -0700 Subject: Re: [PATCH v2 4/6] virtio: Initialize authorized attribute for confidential guest To: Greg Kroah-Hartman , "Michael S. Tsirkin" Cc: "Kuppuswamy, Sathyanarayanan" , Dan Williams , Borislav Petkov , X86 ML , Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Andreas Noever , Michael Jamet , Yehezkel Bernat , "Rafael J . Wysocki" , Mika Westerberg , Jonathan Corbet , Jason Wang , Kuppuswamy Sathyanarayanan , Linux Kernel Mailing List , Linux PCI , USB list , virtualization@lists.linux-foundation.org, "Reshetova, Elena" References: <20210930010511.3387967-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210930010511.3387967-5-sathyanarayanan.kuppuswamy@linux.intel.com> <20210930065953-mutt-send-email-mst@kernel.org> <6d1e2701-5095-d110-3b0a-2697abd0c489@linux.intel.com> <1cfdce51-6bb4-f7af-a86b-5854b6737253@linux.intel.com> <64eb085b-ef9d-dc6e-5bfd-d23ca0149b5e@linux.intel.com> <20211002070218-mutt-send-email-mst@kernel.org> From: Andi Kleen Message-ID: <95ba71c5-87b8-7716-fbe4-bdc9b04b6812@linux.intel.com> Date: Sat, 2 Oct 2021 07:20:22 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/2/2021 4:14 AM, Greg Kroah-Hartman wrote: > On Sat, Oct 02, 2021 at 07:04:28AM -0400, Michael S. Tsirkin wrote: >> On Fri, Oct 01, 2021 at 08:49:28AM -0700, Andi Kleen wrote: >>>> Do you have a list of specific drivers and kernel options that you >>>> feel you now "trust"? >>> For TDX it's currently only virtio net/block/console >>> >>> But we expect this list to grow slightly over time, but not at a high rate >>> (so hopefully <10) >> Well there are already >10 virtio drivers and I think it's reasonable >> that all of these will be used with encrypted guests. The list will >> grow. > What is keeping "all" drivers from being on this list? It would be too much work to harden them all, and it would be pointless because all these drivers are never legitimately needed in a virtualized environment which only virtualize a very small number of devices. > How exactly are > you determining what should, and should not, be allowed? Everything that has had reasonable effort at hardening can be added. But if someone proposes to add a driver that should trigger additional scrutiny in code review. We should also request them to do some fuzzing. It's a bit similar to someone trying to add a new syscall interface. That also triggers much additional scrutiny for good reasons and people start fuzzing it. > How can > drivers move on, or off, of it over time? Adding something is submitting a patch to the allow list. I'm not sure the "off" case would happen, unless the driver is completely removed, or maybe it has some unfixable security problem. But that is all rather unlikely. > > And why not just put all of that into userspace and have it pick and > choose? That should be the end-goal here, you don't want to encode > policy like this in the kernel, right? How would user space know what drivers have been hardened? This is really something that the kernel needs to determine. I don't think we can outsource it to anyone else. Also BTW of course user space can still override it, but really the defaults should be a kernel policy. There's also the additional problem that one of the goals of confidential guest is to just move existing guest virtual images into them without much changes. So it's better for such a case if as much as possible of the policy is in the kernel. But that's more a secondary consideration, the first point is really the important part. -Andi