Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1307717pxb; Fri, 20 Nov 2020 06:33:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3K/iL3ZfRNXGHzzrrcwSR2nWHrdxC5OOIIKXaNz/Gsvjg+J/fB92XnLt+op9fqpY9NJwo X-Received: by 2002:a17:907:4186:: with SMTP id mz6mr34534730ejb.175.1605882791419; Fri, 20 Nov 2020 06:33:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605882791; cv=none; d=google.com; s=arc-20160816; b=AdP1NNAYMeOnPZlpUW2GN3njRlWbeyVx35DSIrpNkzGO1UyhNnCA75rqOAgxK2xGJj aU6lJY1FIUnIVBYbrA+an+oSZwTOyrAHMg/iqSFyYqfULYyiiq30oubk2Qwv+wIeZP7g GZzdLBS9H3m6031eq4815d5nv3TRbCmRBpOVmrmz3G1JfQAF3o6V9ULI383OpQ3dcVCU IarYhuf7hNW1DJnxJJ9b2CArFrw4HUaa7Md4ao/OrUnnd+GuEUZoslEAQvpt4huYpveR abFXrUNWNOBsEOILIWYEO/OYJsPXZ/3MVIG3tm/+sC9nTd29v0AdVM3K9ov1sPmFzqXd dY9w== 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=tDnFdOBIEr7ykVCe5q2ZgXBO8VDQJEYcK1nUf3k+5GU=; b=AR3Cjwi9aS8EkK0eSd2BxeWxyiCWslJdWpzwQAPugdwRQqJJSU/E3ONKojHHiFyWWZ AbYvnEubopbQrEsMZ2VFjBQRhlx/49btfQDglg0eAZBjRalF+Mu0x2t+8UXQAjTt2dZM xs08JvERZCNBPH7fiUuoSoFC5BXmScnpzkru7jLc9J0UJF38P3icxmgt/R7rnCjUft+z NqwDjvlsjEhqstSwaUA+e27x31CGWVt/18TDz3uF55aWXXTlc244dY4znCGLDw61lhdh FYcfm8KfVUWLc02ZEVJiNlPi7tc0ingvcR1sw2JQXFa0BCvJ+U0jnhbnfo4llC9YdTtz YV+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=isGoTN8k; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si1707671edh.491.2020.11.20.06.32.44; Fri, 20 Nov 2020 06:33:11 -0800 (PST) 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=@kernel.org header.s=default header.b=isGoTN8k; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727655AbgKTO36 (ORCPT + 99 others); Fri, 20 Nov 2020 09:29:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:60340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbgKTO36 (ORCPT ); Fri, 20 Nov 2020 09:29:58 -0500 Received: from dhcp-10-100-145-180.wdc.com (unknown [199.255.45.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EED1A2224C; Fri, 20 Nov 2020 14:29:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605882597; bh=D7G2QiwBgP/TgokMQw/VvHYyaDp0QQP9o0ZunMnsyT4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=isGoTN8kfGIgpSbhE+UqwrB7/Skyo0gqfxICHnyceiFYzpW00hjsAjBTvntcyUKxY afDFDsZQttR236cf1dHhTGnTaLfA+HEH5+fdi4lZYwo2byBxGXd6i8OANyBUXmE2Xz trRVLG/1iNk40+kUv+JMvCu2+p4E75DwEvxTLhWM= Date: Fri, 20 Nov 2020 06:29:54 -0800 From: Keith Busch To: Christoph Hellwig Cc: Tom Roeder , Jens Axboe , Sagi Grimberg , Peter Gonda , Marios Pomonis , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] nvme: Cache DMA descriptors to prevent corruption. Message-ID: <20201120142954.GC2855047@dhcp-10-100-145-180.wdc.com> References: <20201120012738.2953282-1-tmroeder@google.com> <20201120080243.GA20463@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201120080243.GA20463@lst.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 20, 2020 at 09:02:43AM +0100, Christoph Hellwig wrote: > On Thu, Nov 19, 2020 at 05:27:37PM -0800, Tom Roeder wrote: > > This patch changes the NVMe PCI implementation to cache host_mem_descs > > in non-DMA memory instead of depending on descriptors stored in DMA > > memory. This change is needed under the malicious-hypervisor threat > > model assumed by the AMD SEV and Intel TDX architectures, which encrypt > > guest memory to make it unreadable. Some versions of these architectures > > also make it cryptographically hard to modify guest memory without > > detection. > > I don't think this is a useful threat model, and I've not seen a > discussion on lkml where we had any discussion on this kind of threat > model either. > > Before you start sending patches that regress optimizations in various > drivers (and there will be lots with this model) we need to have a > broader discussion first. > > And HMB support, which is for low-end consumer devices that are usually > not directly assigned to VMs aren't a good starting point for this. Yeah, while doing this for HMB isn't really a performance concern, this method for chaining SGL/PRP lists would be. And perhaps more importantly, the proposed mitigation only lets the guest silently carry on from such an attack while the device is surely corrupting something. I think we'd rather free the wrong address since that may at least eventually raise an error.