Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2276906pxb; Sat, 2 Oct 2021 11:47:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDrOJVfa880AhSdnZvEOanXtH/blzVzmU1AH0d1eGq+khg6Jucsef316nF1847XwfytqR4 X-Received: by 2002:a17:906:6558:: with SMTP id u24mr5820395ejn.361.1633200445318; Sat, 02 Oct 2021 11:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633200445; cv=none; d=google.com; s=arc-20160816; b=EziJ/gRuvBsITERp+2XJ1AE/uOt/BnHrsP14a0o5d27fuCa4KToRuQR17K1O7nweSg i1wIyUeY7CJmZV+r0pXkObSCFt3goHyytavZ0fbZNaKl+l8uHInlWK6MJfpPm9gcYgEC MxCiK1Wicx+Jz9dbJBO3FWMUNexQl8Lug1bhrUaxErRgqGfHzu1fx4qFIllHPjS9s7DG QacpCVO9yJ59I8g9VM9SpMAQ6oUeE0Q8iVTSg2C0eztWt9phxsDO/hZgH81n/uiICHh0 T0JSrjmMIiGM5ni1mz7FLFvU1RynKJPyRpK1zO/kqIRt8DcbQH860uplxQrB7MZJThDT MixA== 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=ST0KR7EU4N0YWDaDZLrBL4QmpL0x0hJwSn6j1QI0rBo=; b=sXsLm/6IniJmQuvlsaf9LYlLdmLQguY9aRG+yEF+soS1sV1GGjxyTl6UrlnESNSxQR 87EUyAH1gpnmKU7HXNsdiPeJ0kac9ewz5xnzWWMBc+cd2mPa8j2xNvcPu9XsRf46PEBY TDJkCM3+g+LwFj4U15RK4CcJcPaAjck+kwsSoGt7Dv66SEC/8BJ8FAsDxiqKm9S8jigJ 2IhDDdkXIPxcP8+hXz9wtYwV8Sc/cjLTrp1MS82E+KhMc7+gpRKFvidqmUDV108aU4I2 Pnd/0dU7xE4h0LAufPpUnLWO3d1Fe+gdRDDLXVymae5WZs5q5FJMZyvg+lw7EKx8KkAL HMOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dgiOnu3n; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu1si12023707ejb.482.2021.10.02.11.46.59; Sat, 02 Oct 2021 11:47:25 -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=@redhat.com header.s=mimecast20190719 header.b=dgiOnu3n; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233861AbhJBSmy (ORCPT + 99 others); Sat, 2 Oct 2021 14:42:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45133 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233776AbhJBSmx (ORCPT ); Sat, 2 Oct 2021 14:42:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633200066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ST0KR7EU4N0YWDaDZLrBL4QmpL0x0hJwSn6j1QI0rBo=; b=dgiOnu3nH8tyt5Nyavzh07OAjvqIMozG2XqB+pkeRO/1LpmwT8but50Zu1hKutGfFRY/FQ hRS3e/fExo4ZQ2hS3yqGMKJxv8Np8XlEC6Ie/IGYSzOWRe20Dn5LsNej9TAQhWr2tHtn48 8ZqwVM8ROduy0VCIRH4iEOwjV3XDMYA= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-482-IAN7rxtMNSqxYHRpI-UnjQ-1; Sat, 02 Oct 2021 14:41:03 -0400 X-MC-Unique: IAN7rxtMNSqxYHRpI-UnjQ-1 Received: by mail-ed1-f72.google.com with SMTP id n19-20020a509353000000b003dad185759bso5366899eda.6 for ; Sat, 02 Oct 2021 11:41:03 -0700 (PDT) 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=ST0KR7EU4N0YWDaDZLrBL4QmpL0x0hJwSn6j1QI0rBo=; b=qCIzG9bEoB2uKpn1NU9GgoQ8Rf16f9Th8ipxTdqtKTac3uyZFMbxy+yPY8wa6nKn72 Z2rCJKM4qjwwmyNdP8uVQrBTij2mXppKXpiWbZL6ChVioB6VZn3x0vMLAGRTfY2ZdA7C wcCsGuuoF+Yocut6hSixHpDA7bJqQgSeRBrM3mxFFL6BR9JEHfCYawFi2Kv0JayUeD1o UkP3QHvykSvx9ELWyvd5r6aJ9lclAdRKSrrTyqy+wyxXRT13drl+9nZoJU8NG18cVySd mz+7TX+la0i7PB6uf7MKHLPBNylvBQvHW4p7G+OQwt470D3FL/9ntgI0FMjRyY6+SF36 lgxA== X-Gm-Message-State: AOAM533AOnS8j1QLUB/GL397WHTK2tKaFnsDQtni0O8lDqMSJanA1WcW FVauAAVOIevQZxaqNdvcHIkTcOPaZ2oCGiTr91jcJuPCpQ2CBfwnzjg1Fsr/Zi00a7uXGwAwnSq +BsAax/4fYS1iK5rHJLJgl0J4 X-Received: by 2002:a50:da8d:: with SMTP id q13mr5838523edj.198.1633200062590; Sat, 02 Oct 2021 11:41:02 -0700 (PDT) X-Received: by 2002:a50:da8d:: with SMTP id q13mr5838496edj.198.1633200062359; Sat, 02 Oct 2021 11:41:02 -0700 (PDT) Received: from redhat.com ([2.55.22.213]) by smtp.gmail.com with ESMTPSA id a23sm4866108edv.33.2021.10.02.11.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 11:41:01 -0700 (PDT) Date: Sat, 2 Oct 2021 14:40:55 -0400 From: "Michael S. Tsirkin" To: Andi Kleen Cc: Greg Kroah-Hartman , "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" Subject: Re: [PATCH v2 4/6] virtio: Initialize authorized attribute for confidential guest Message-ID: <20211002142138-mutt-send-email-mst@kernel.org> References: <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> <95ba71c5-87b8-7716-fbe4-bdc9b04b6812@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95ba71c5-87b8-7716-fbe4-bdc9b04b6812@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 02, 2021 at 07:20:22AM -0700, Andi Kleen wrote: > > 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. Looks like out of tree modules get a free pass then. Which is exactly the reverse of what it should be, people who spent the time to get their drivers into the kernel expect that if kernel decides to change some API their driver is automatically updated. This was always the social contract, was it not? > 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. IIUC userspace is the distro. It can also do more than a binary on/off, e.g. it can decide "only virtio", "no out of tree drivers". A distro can also ship configs with a specific features enabled/disabled. E.g. I can see where some GPU drivers will be included by some distros since they are so useful, and excluded by others since they are so big and hard to audit. I don't see how the kernel can reasonably make a stand here. Is "some audit and some fuzzing" a good policy? How much is enough? > Also BTW of course user space can still override it, but really the defaults > should be a kernel policy. Well if userspace sets the policy then I'm not sure we also want a kernel one ... but if yes I'd like it to be in a central place so whoever is building the kernel can tweak it easily and rebuild, without poking at individual drivers. > 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. If it's e.g. the kernel command line then we can set that when building the kernel right? No need for a dedicated interface just for this ... > But that's more a secondary consideration, the first point > is really the important part. > > > -Andi