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.129.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 90786346E55 for ; Fri, 17 Jul 2026 10:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784283051; cv=none; b=H3GjeEVlEd+0GibWNuZdAos62vpkeONpIPn5pEGBynM24BFQuQynRGmJYBiTeeLVicu8qo8sJWbmSf0TM1DkAoWv9QWOK9QZuTdRFK3SsNXistxr/MhPmRUZCuHND1T2Fyv3AIMh4OdVQ3rB5nIRpJh64O9eZBua3fdRLl0wGEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784283051; c=relaxed/simple; bh=dVkLI/dcu4rYDpKVXf27xgtVxW4eLo84057u7xqAgTw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LqEciZ08FoahRzdic4mGK0UZoJmqB1B3me5vZoL34ucs7GMC/89Wb2LMxkiOJgxBvo24pY75p2VwEc8Z1II61+m2rejB6EzuE4tcLnPjLL2xuDJGwmqKFHnC7Gta6Zj4avD6G3KMovmV0SC7w5KgLDRQ2FoWADU8fWBnpTe/+n8= 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=QBy4QwQl; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=UXUE4dDk; arc=none smtp.client-ip=170.10.129.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="QBy4QwQl"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="UXUE4dDk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784283048; 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=Zs9dewdrHqMzHoHYwCuotrkR4F9NeI4ZAIdhWqpau6M=; b=QBy4QwQlIkxhu3AYeCIun8aPxpeUSix3eBScISBvGwXE+jw4tZJUt4B11UJQMG6WyaK5/Q 9JPMvXfl7pOpqdniTwVE0cB6Frre0V7xgFH2eAwQvOqkfEQLq2reNvK4ilWcRukRycEL2R R4s32SWvEIGGpzplfr6vgYqsPoOVMSc= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-27-OIXhVYBGMdSc4ZTBYF0EFA-1; Fri, 17 Jul 2026 06:10:46 -0400 X-MC-Unique: OIXhVYBGMdSc4ZTBYF0EFA-1 X-Mimecast-MFC-AGG-ID: OIXhVYBGMdSc4ZTBYF0EFA_1784283045 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-472bdd6f529so4733511f8f.1 for ; Fri, 17 Jul 2026 03:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784283045; x=1784887845; 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=Zs9dewdrHqMzHoHYwCuotrkR4F9NeI4ZAIdhWqpau6M=; b=UXUE4dDkZ5HJy8DTmLdJctEdqAr43xr1q2IfJxU1sP3onFZ83YMSprEB1LzBV0Ai5a cOqOuSOKMkIIsG7lPX6TvvrStUSBa/VEJ4O2qV14GWSZQGHBeG2uZA8XzZWy7vlrUPd4 ui7UQZlFNruS8EMysv2Jww/soqWBCJJCJcmVz/QZ1o4cuaSPUHx7B3U34Ggxrv4OKjDc Qw4m2WjE7ts0QZhNe9UgjWXxbO6HiID21Qf3LWGX8BV5DkNNH5KMBV4F6MuixwNTmRFz ZFtDS50zAAPLszGm35zpSU23UwFQXF+eTQrmVAbORCuvX1Ai5qWfRyOvVzc7wxjTA1kB xpCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784283045; x=1784887845; 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=Zs9dewdrHqMzHoHYwCuotrkR4F9NeI4ZAIdhWqpau6M=; b=ezJ3iP2OMxIgfqr1LL9SHppGCVo6mM343R3by1tqLOlyYGxSkGhD52V7hrkUdG3bEy d8rldFWU+zoJzl3ma1A72lpzS3f2sfjfegwezYJI+dzPwK5AhuwZP4vOdXpBxytfRNgr ECl1ETPbeXIlCxN9y9zwmvYpHzuigLyHlgmh/6et86JEeW2IaQw0VYER/ZMXAaGn1qX/ n7d1zygA2nkfblv/D4zfd3GL0J3p0tDrUvE2JlJ6SEZeb2bVA3zbEsl7a6t2mK/QZ3Qm lKb+CHyLOzgUwiloqJIT5iQuUL8dXhXRmSsB3Euif2FrIvCcXiXleVyqYGHry0J+UpWp Ihhg== X-Forwarded-Encrypted: i=1; AHgh+RoQ8JKql9zAFtDONezwuH0gStX7Lp7SQ+HvKhICNquestRmtAyVbZO4e08UNoHkzlvGLIc2Jr/e/nrbcNo=@vger.kernel.org X-Gm-Message-State: AOJu0YzwrgJWQowszKbxXmasAO4bfo6zYfJJqCQTW6kER9YOwxWiTG6n QgU9MnEWOB8d1nOH3QFnHgCw9LykvWCV09+WC5vUopPO6q+FzV/YHsBpEq1clBVdeohC3+gmw3V vQ9Tt9+8o0mLyoiTqrlR0BGMI7/9Yjw5nGpejmP/RCTR7tu+O/4cahqj9og2LtcDlcA== X-Gm-Gg: AfdE7cn2FDcNvpzP0k1dSzEEo3Go950rLtPY/WSBF9yMhBuvZ10L3n2iTDFWDZjhrIc 5joXwBFNUxjKJ6gdj/VRsETtU8I4F/xlokpvO0jZL0c0hX4pWpLwHqyYnM2HXJ74SQ5y9ZWymSH L6hXLfJ6zjelK76vivgedscvNwnbaIQ3UOpnGw7GmM69K8fBC27kOrbRGjcAnYEFFQDDkUNPZTQ eX+181cFjfcembjA98yX5xzecI+BOEF8H666T1ufS2ImQjTqrWGvSUE4vuwQBOTQ8NcjpD5hqbr vqJMi3V8iWExCdDtcPK36aOGWLRAsDtOKfVjtUg4kmCXeDkR4Ut+QdkzSle2NYNCzi4nXZu0NZ6 0fFP+/D4KHLzZ8OVaX5ocFJEI X-Received: by 2002:a05:6000:4a1e:b0:46b:7f57:7109 with SMTP id ffacd0b85a97d-47f6230c3d9mr2604632f8f.20.1784283045122; Fri, 17 Jul 2026 03:10:45 -0700 (PDT) X-Received: by 2002:a05:6000:4a1e:b0:46b:7f57:7109 with SMTP id ffacd0b85a97d-47f6230c3d9mr2604578f8f.20.1784283044462; Fri, 17 Jul 2026 03:10: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-47f63e49ab8sm2880522f8f.5.2026.07.17.03.10.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2026 03:10:43 -0700 (PDT) Date: Fri, 17 Jul 2026 06:10: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: <20260717060822-mutt-send-email-mst@kernel.org> References: <20260715142337.22811-2-harimishal1@gmail.com> <20260715164139.40957-1-harimishal1@gmail.com> <2026071635-relive-flogging-2a81@gregkh> <4dda47ba-534a-4297-a25e-0d63d9167033@kernel.org> <20260717014134-mutt-send-email-mst@kernel.org> <3b32a38f-0964-45b9-9529-933abedbf69b@kernel.org> <20260717044019-mutt-send-email-mst@kernel.org> <2026071746-deviation-clad-1712@gregkh> 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: <2026071746-deviation-clad-1712@gregkh> 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. -- MST