From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B11BCDB482 for ; Fri, 13 Oct 2023 15:47:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232041AbjJMPrQ (ORCPT ); Fri, 13 Oct 2023 11:47:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232410AbjJMPrP (ORCPT ); Fri, 13 Oct 2023 11:47:15 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B732BE for ; Fri, 13 Oct 2023 08:47:13 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id AEF3B6732A; Fri, 13 Oct 2023 17:47:08 +0200 (CEST) Date: Fri, 13 Oct 2023 17:47:08 +0200 From: Christoph Hellwig To: Kanchan Joshi Cc: Keith Busch , Christoph Hellwig , axboe@kernel.dk, sagi@grimberg.me, linux-nvme@lists.infradead.org, vincentfu@gmail.com, ankit.kumar@samsung.com, joshiiitr@gmail.com, stable@vger.kernel.org, Vincent Fu Subject: Re: [PATCH v4] nvme: fix corruption for passthrough meta/data Message-ID: <20231013154708.GA17455@lst.de> References: <20231013051458.39987-1-joshi.k@samsung.com> <20231013052612.GA6423@lst.de> <8c755915-2366-28ff-ffd4-be17d797557c@samsung.com> <3438f3b8-f7d4-f0bd-44ef-7efb09ed6151@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3438f3b8-f7d4-f0bd-44ef-7efb09ed6151@samsung.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, Oct 13, 2023 at 08:41:54PM +0530, Kanchan Joshi wrote: > It seems we will have two limitations with this approach - (i) sgl for > the external metadata buffer, and (ii) using sgl for data-transfer will > reduce the speed of passthrough io, perhaps more than what can happen > using the checks. And if we make the sgl opt-in, that means leaving the > hole for the case when this was not chosen. The main limitation is that the device needs to support SGLs, and we need to as well (we currently don't for metadata). But for any non-stupid workload SGLs should be at least as fast if not faster with modern hardware. But I see no way out. Now can we please get a patch to disable the unprivileged passthrough ASAP to fix this probably exploitable hole? Or should I write one?