From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5974942D756 for ; Fri, 17 Jul 2026 16:30:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784305860; cv=none; b=iJkYsZff6nyBAVpHckmFMuLvFAgJ6c2plNoL7YoLpBhAPOQ6jqk+TFrgdFplqJyfQukniXPd1vN4q5p63hLzSApnn0nqSrIuzArQQk/3XHkTsYWS+ZLtmMiHD6ZMp2Cx4tytmPI423V7QAi10b71ID9C7rNyUwalLE53ex7++0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784305860; c=relaxed/simple; bh=RmbGwGg1KzfgJFoufQ7Ebzl+MgXG82cSgzTROQ+0NxU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D4WQVESesZILizs5kMG5Ru33ztIiRccOulu1kOt3/X3Wu2UiAm9b65nCEkbIKyCxayVXzDQxM9oV5qHsqBu8eZiz/ORmEP9uiC7Ymxknyjg9SjQy/YqOWOnCiAu3c65aT/fdOTnXBD54gyzOJD6MIiDrYND9ElnCNAr/SR44b5g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Tg/mbYQY; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Jsw9UmL7; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Tg/mbYQY"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Jsw9UmL7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784305848; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1QyVdvyYwjyVRXdVeS5K/eO0SzcexWnTtdt9J6XLMqg=; b=Tg/mbYQYK+eXdN1eqNd1dVzolFQ/kz6T6b1OtMmO6ItjB40DGrZ6xLeLn6IwSPGW3JhDEU rtEK4ZboRugHfH4DTWvJsNFF9NRkgmJstePSpOHQcTgsGh8GLNwydj41aUOCICHripxHvC KMpwwo9QGkWXSLVwFoaC61sngBEJrCs= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-478-ufsq1lgLPT2mX-z7DczS0Q-1; Fri, 17 Jul 2026 12:30:47 -0400 X-MC-Unique: ufsq1lgLPT2mX-z7DczS0Q-1 X-Mimecast-MFC-AGG-ID: ufsq1lgLPT2mX-z7DczS0Q_1784305846 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-472a798fc7cso3526713f8f.1 for ; Fri, 17 Jul 2026 09:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784305846; x=1784910646; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=1QyVdvyYwjyVRXdVeS5K/eO0SzcexWnTtdt9J6XLMqg=; b=Jsw9UmL71ZGzDAy2RTzvwqPj7wFrSQk0xlBhgoeZt4PiKY64cozB31X0N4DXyNCIk+ zcIqSZLorpNGfVTpRje4jijLwOejBC21+u7InG3HU95oD2Ir75uKuwHVyVkZcCoQNiRR vaw1p20qB9m+oZ9OXEyxSqWRoqTi6XRqHsz8NsCjc5WERFmzHVaWMX4mOnsljc4NIzcq pV9KTgA+eUlKlAP5BKgmfvUbNBJz6WA0pFk2oxH/wYSVs/6PtcUOQaqy6ygadDNeKLze MBLrolAGhIDCLnsfYmYnWJ3xHip5AmP2tPmO7PuMTY4Pc3Z5tYj/5te9+Et5NGRvYLME 9Gzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784305846; x=1784910646; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=1QyVdvyYwjyVRXdVeS5K/eO0SzcexWnTtdt9J6XLMqg=; b=fSEGMJpU2JAX1cmHmiA7LkO6hyXhLKA/mUGP+pUtclJ/NZGM9Mmil5CAt2CA/OjepH /wBPHHrlvnuqBLn9Ogpa0zZwhsIlWH3paOg27XUwpnvkN8hzQvXdjDqtjrDZx+NkbCou Ur0u/mtIA/CpDvgML9gtKOm5OvpNwYLUifB9HLZzxPQYD/Q8qah9R/XUpj4iG8YnLOXI +zDBCilWtzL6Dr4A6yo7ZP1x4wEBNCPYSMgT1e5PSTFSoYOKwfOzwv7sT+RKosnzckzM 6eLhyyVNSjNagMXn+TgRjQVm8dJf+AZnukJeVRN6FU+AHPqDIq9TU1jUhvxqUqLOcPc5 jR1Q== X-Forwarded-Encrypted: i=1; AHgh+RqA9gMhivaP/7BLYpT4sUB6PbXk2Qqw+S3svOG55kGbxyCV4gzr0Sr+YVE2hSVARGkDSg1K2iEccP4sLDY=@vger.kernel.org X-Gm-Message-State: AOJu0YyVzYtevCVsKPrs7b2uzQfU2rUBp1QBP0T4tsX97/rf3n6pD+7t Y6sHR+pkoTLMEvcOCfF+Iogkf5oovemOtiwRjh99VSbGn9Kc9rBK8K73TPSNFhX6p6T3DojIvF6 0PDoyXNA1TA9hzM4HoRjLoYnpBazJzfReQczJu+siGR+rfn0LtwlBgzSOEDQ6wOUzVg== X-Gm-Gg: AfdE7ckOhehyKSB7AdG5ZbFnWl+toowYZuWNy4OWYSOiS8/BUnE29pql5PH9jgLV0LA 3XdJ07jbDKqkmD3L1qorN8XofaZ45vvrJbmqgEmk2Sx4hANgXZp8u3EIEKoDbRUkN0qJEj6MpR+ XDrWtIGxqe6NLaUsNPtdiu/ZTrZNXHScaSk5BLV0Dy1kagKlACTKQXaltCWQ624uSXRVO1HRIQJ A9p7Uo7t9E3qv7VceiwDwXqbulzMJ/7jUB9yVUf2duudT8CzwNOa7+MK3WHK2ptiv3IIJbKRLh5 W2ofS6wZM7RDy0mYii8Yxlub0UWWFBM9ArAPEYwTdHW5CuMobPI/Zc13MoSWosLTmvjuSbURLVX E4OaNNLiUQtO65OZ74Y/zfTrS X-Received: by 2002:a05:6000:2c03:b0:473:975c:4fd1 with SMTP id ffacd0b85a97d-47f62314f83mr4384485f8f.25.1784305845568; Fri, 17 Jul 2026 09:30:45 -0700 (PDT) X-Received: by 2002:a05:6000:2c03:b0:473:975c:4fd1 with SMTP id ffacd0b85a97d-47f62314f83mr4384417f8f.25.1784305844884; Fri, 17 Jul 2026 09:30:44 -0700 (PDT) Received: from redhat.com (IGLD-80-230-24-117.inter.net.il. [80.230.24.117]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f63e52f81sm5426688f8f.9.2026.07.17.09.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2026 09:30:44 -0700 (PDT) Date: Fri, 17 Jul 2026 12:30:41 -0400 From: "Michael S. Tsirkin" To: Greg Kroah-Hartman Cc: "David Hildenbrand (Arm)" , Hari Mishal , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, elena.reshetova@intel.com, carlos.bilbao.osdev@gmail.com Subject: Re: [PATCH v2 1/4] virtio-mem: validate device-reported block size Message-ID: <20260717122954-mutt-send-email-mst@kernel.org> References: <2026071746-deviation-clad-1712@gregkh> <20260717060822-mutt-send-email-mst@kernel.org> <2026071757-grout-composer-165d@gregkh> <20260717061901-mutt-send-email-mst@kernel.org> <2026071724-asleep-pedigree-ea54@gregkh> <20260717065219-mutt-send-email-mst@kernel.org> <2026071759-thermal-synopsis-7568@gregkh> <20260717085838-mutt-send-email-mst@kernel.org> <2026071724-modulator-pliable-fa1c@gregkh> <20260717122729-mutt-send-email-mst@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260717122729-mutt-send-email-mst@kernel.org> On Fri, Jul 17, 2026 at 12:28:45PM -0400, Michael S. Tsirkin wrote: > On Fri, Jul 17, 2026 at 04:31:03PM +0200, Greg Kroah-Hartman wrote: > > On Fri, Jul 17, 2026 at 09:08:23AM -0400, Michael S. Tsirkin wrote: > > > On Fri, Jul 17, 2026 at 02:07:50PM +0200, Greg Kroah-Hartman wrote: > > > > On Fri, Jul 17, 2026 at 06:52:46AM -0400, Michael S. Tsirkin wrote: > > > > > On Fri, Jul 17, 2026 at 12:46:52PM +0200, Greg Kroah-Hartman wrote: > > > > > > On Fri, Jul 17, 2026 at 06:23:57AM -0400, Michael S. Tsirkin wrote: > > > > > > > On Fri, Jul 17, 2026 at 12:15:09PM +0200, Greg Kroah-Hartman wrote: > > > > > > > > On Fri, Jul 17, 2026 at 06:10:41AM -0400, Michael S. Tsirkin wrote: > > > > > > > > > On Fri, Jul 17, 2026 at 11:14:23AM +0200, Greg Kroah-Hartman wrote: > > > > > > > > > > On Fri, Jul 17, 2026 at 04:59:32AM -0400, Michael S. Tsirkin wrote: > > > > > > > > > > > On Fri, Jul 17, 2026 at 10:39:40AM +0200, David Hildenbrand (Arm) wrote: > > > > > > > > > > > > On 7/17/26 07:48, Michael S. Tsirkin wrote: > > > > > > > > > > > > > On Thu, Jul 16, 2026 at 05:59:05PM +0200, David Hildenbrand (Arm) wrote: > > > > > > > > > > > > >>> Or do we just always trust virtio mem devices explicitly? > > > > > > > > > > > > >> > > > > > > > > > > > > >> It's hard for me to understand where we draw the line, really. > > > > > > > > > > > > >> > > > > > > > > > > > > >> But maybe MST can clarify what we care about in virtio world where the > > > > > > > > > > > > >> hypervisor is fully in charge of the device, > > > > > > > > > > > > > > > > > > > > > > > > > > Generally: > > > > > > > > > > > > > - The guest is expected to whitelist drivers (most drivers have not > > > > > > > > > > > > > been audited). > > > > > > > > > > > > > > > > > > > > > > > > But even if you audited your driver, who makes sure that we consider all ways > > > > > > > > > > > > where the device could mess with us? > > > > > > > > > > > > > > > > > > > > > > A lot of this is up to a correct setup. For example, make sure all > > > > > > > > > > > filesystems are encrypted and refuse to mount unencrypted ones. > > > > > > > > > > > > > > > > > > > > > > > Something feels off here. > > > > > > > > > > > > > > > > > > > > > > > > Handling selected out-of-spec scenarios like this feels like a band-aid. Happy > > > > > > > > > > > > to be corrected. > > > > > > > > > > > > > > > > > > > > > > Well Documentation/security/snp-tdx-threat-model.rst puts it like this: > > > > > > > > > > > It is important to note > > > > > > > > > > > that this doesn’t imply that the host or VMM are intentionally > > > > > > > > > > > malicious, but that there exists a security value in having a small CoCo > > > > > > > > > > > VM TCB. > > > > > > > > > > > > > > > > > > > > > > and > > > > > > > > > > > > > > > > > > > > > > While traditionally the host has unlimited access to guest data and can > > > > > > > > > > > leverage this access to attack the guest, the CoCo systems mitigate such > > > > > > > > > > > attacks by adding security features like guest data confidentiality and > > > > > > > > > > > integrity protection. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > now, when we are talking about "mitigation" it is indeed becoming a bit > > > > > > > > > > > murky. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > For me, a rule of thumb I came up with is that if the validation happens > > > > > > > > > > > to also be helful for users e.g. to work around buggy devices, > > > > > > > > > > > or maybe because we feel failing gracefully is nice because this > > > > > > > > > > > will allow to later make use of this config and old drivers will > > > > > > > > > > > fail but at least not panic, then it is good to include. > > > > > > > > > > > > > > > > > > > > Why not do what USB does? Don't trust the device until AFTER probe() > > > > > > > > > > succeeds? All of the needed checking should happen before then, as that > > > > > > > > > > is a "slow path" so lots of validation and the like can happen at that > > > > > > > > > > point. > > > > > > > > > > > > > > > > > > > > After that, during the normal data paths, after the driver is bound, > > > > > > > > > > trust it all you want as attempting to validate every single packet is > > > > > > > > > > just going to be impossible. > > > > > > > > > > > > > > > > > > > > thanks, > > > > > > > > > > > > > > > > > > > > greg k-h > > > > > > > > > > > > > > > > > > People do expect that data path validation at this point. > > > > > > > > > > > > > > > > Ok, so you want this patch :) > > > > > > > > > > > > > > > > And more, as you need to treat everything from the host as "untrusted", > > > > > > > > and it must be "verified". > > > > > > > > > > > > > > Well. First it's not me) Second it's only specific configurations - > > > > > > > for example there's no short term plan to validate filesystem code, people > > > > > > > are expected to rely on encryption. The reasons have more to do > > > > > > > with the available manpower than anything else. > > > > > > > > > > > > Sure, but again, for subsystems, you have to define your threat model as > > > > > > the LLMs are churning against the code base and coming up with lots of > > > > > > crazy ideas if a device should or should not be trusted and spitting out > > > > > > patches and reports like the ones that are in the first few patches of > > > > > > this series. > > > > > > > > > > > > So please, pick a model, let's document it, and go with that. I am > > > > > > getting directly conflicting responses here. > > > > > > > > > > > > thanks, > > > > > > > > > > > > greg k-h > > > > > > > > > > Supposed to be this one: > > > > > Documentation/security/snp-tdx-threat-model.rst > > > > > > > > > > what is missing? > > > > > > > > A policy decision that needs to be made. All that document does is > > > > describe a bunch of different "threats" yet does not decide what to do > > > > about them at all from what I can tell. > > > > > > That would be this section I think: > > > > > > The **Linux kernel CoCo VM security objectives** can be summarized as follows: > > > > > > it does, indeed, not go into detail about how to interact, safely, > > > with untrusted entities. Does it really need to be spelled out? > > > > Seems like it as I didn't figure it out at all :) > > > > > > And that's just for one subset of the CoC world, right? Is that > > > > something that all virtio drivers need/want to care about? > > > > > > What is missing, and what you seem to be asking for, is an opinionated > > > stance on which drivers we care about in this world? > > > True. > > > > Yes. > > > > > coco guys tried to annotate drivers at some point to do exactly that. > > > this was rejected upstream from the position that this is not > > > different from handling buggy hardware, and just to fix all drivers. > > > so it's up to users, and I guess for virtio the answer is yes > > > with some exceptions because we don't have a better answer right now. > > > > Ok, so back to the original question here: > > > > > > So I don't see a real answer to the "does Linux trust the host to give > > > > you good data or not" question in that file, am I missing it? > > > > > > > > thanks, > > > > > > > > greg k-h > > > > > > This? Note the last sentence. > > > > > > The **Linux CoCo VM attack surface** is any interface exposed from a CoCo > > > guest Linux kernel towards an untrusted host that is not covered by the > > > CoCo technology SW/HW protection. This includes any possible > > > side-channels, as well as transient execution side channels. Examples of > > > explicit (not side-channel) interfaces include accesses to port I/O, MMIO > > > and DMA interfaces, access to PCI configuration space, VMM-specific > > > hypercalls (towards Host-side VMM), access to shared memory pages, > > > interrupts allowed to be injected into the guest kernel by the host, as > > > well as CoCo technology-specific hypercalls, if present. Additionally, the > > > host in a CoCo system typically controls the process of creating a CoCo > > > guest: it has a method to load into a guest the firmware and bootloader > > > images, the kernel image together with the kernel command line. All of this > > > data should also be considered untrusted until its integrity and > > > authenticity is established via attestation. > > > > Great, so you are saying that we need to fix any bug found where a host > > could be sending "bad" data over the virtio path before, and after, the > > driver is bound to the device. That's a solid answer, and let's let the > > LLMs run with that! > > > > Which also implies that the first 3 patches here are acceptable, right? > > :) > > > > thanks, > > > > greg k-h > > The 1st patch has nothing to do with coco. Bad values it checks do not > lead to any information leak. I'm fine with it as such > but I > would like the commit log to make that clearer. Or to be more precise, I'd like the motivation to be documented, given it is not coco, and then I can judge the merits. > > -- > MST