Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4809992pxb; Mon, 28 Mar 2022 03:54:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx70Ta9iCJxEQT/vQ3FQrwf1/CFXsphTwHNvXViMhcg3pptA5B7pht08xJvdpuaw/Tl0rWY X-Received: by 2002:a05:6402:524c:b0:419:4d8c:e959 with SMTP id t12-20020a056402524c00b004194d8ce959mr15343089edd.398.1648464849359; Mon, 28 Mar 2022 03:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648464849; cv=none; d=google.com; s=arc-20160816; b=b1SLGK36JNNqxc11n9ANGw1RatehJG/HueFcWaCTM8pM6neei9SU1dYqC34pSBx8Hh jbUYOqz+8ergN70fqMeo3PKBPcKG0sO/SCv4VARoE6dvJLNA2fO2hF6MSCU70h7bWSew CYjsgcjR2oNmhhbiesSmSOUOiD4QJBwkakBkr2352lvSnkyuup0GZ7F98j7NgeBgITcw cEb33Bdp4fmT6PFsd6/ldrfArromfMzyriKFP/cpFhh9NP7UGVyoHTs9kpT2tNLpdDpL jkSb2giCEoqk6fWmQOml/bhRvDiYBnpawfDVTmZzhbnMVIThxorsfdJlH2dazfofXAZ4 AbRg== 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=9hriO+vWSdR1TNgrG8ueZJJAnBiSvV9DvaTJC8m+c6s=; b=cgx97Pnz5XBmoTgyFmuy6A8zCBwW4Xu+5zPBMIsHjsOrKG7s8eaFOUvIsCT4iqtual o4FQgW5yZl408QerrqbqEUmqaVh2rkmfGQndlAn4jTzibdBoETejhDUd0XoJdkzLzIql 9LLmPLtS8Pdf8+VQpJpLDLtUEWtXQa8LxZpZCu6EQj2kF3l86DxQ88T+KWFBOPJf4bMd 8gzDNbI779y4mB5oFVt52a4QvuhsRzyK04Q/IhBkq/5ADXE0FltKMgR7v+PaXpU9Hwez CGYEyNPnPsGX72zwNjYvbPI363wKwvsDnNZKrC3dNWgbIFfysAfRp1Kc6zJ1eiAPojdb /MEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qs/+XN8V"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a170906060b00b006df76385d32si14216717ejb.466.2022.03.28.03.53.43; Mon, 28 Mar 2022 03:54:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qs/+XN8V"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236270AbiC1IXY (ORCPT + 99 others); Mon, 28 Mar 2022 04:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbiC1IXX (ORCPT ); Mon, 28 Mar 2022 04:23:23 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC80053704; Mon, 28 Mar 2022 01:21:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 48F92CE1268; Mon, 28 Mar 2022 08:21:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F124C004DD; Mon, 28 Mar 2022 08:21:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1648455699; bh=rGS3hg/MsslSpTPtajHfguVHB2camyQ2cJ7EAOHchlQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qs/+XN8V+cYmkweV7abKvrL3IsgVrtYiptavboQsW+qhYyMmfxoKl0neGLCXm9zJj RbBpQ8TA2CzS7ZzzfNa4B7e5ffpc7zwQ2SjLlxqXaHUcj30lA+q/FN3zgXl9m2wFHp 9/GdzpUMeyVxruRswzKx1YEX8m7y08yBYLqWm5JQ= Date: Mon, 28 Mar 2022 10:21:37 +0200 From: Greg Kroah-Hartman To: Linus Torvalds Cc: Linux Kernel Mailing List , stable , Halil Pasic , Christoph Hellwig Subject: Re: [PATCH 5.10 11/38] swiotlb: rework "fix info leak with DMA_FROM_DEVICE" Message-ID: References: <20220325150419.757836392@linuxfoundation.org> <20220325150420.085364078@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 27, 2022 at 11:02:12AM -0700, Linus Torvalds wrote: > On Sun, Mar 27, 2022 at 2:30 AM Greg Kroah-Hartman > wrote: > > > > But why did you just revert that commit, and not the previous one (i.e. > > the one that this one "fixes")? Shouldn't ddbd89deb7d3 ("swiotlb: fix > > info leak with DMA_FROM_DEVICE") also be dropped? > > The previous one wasn't obviously broken, and while it's a bit ugly, > it doesn't have the fundamental issues that the "fix" commit had. > > And it does fix the whole "bounce buffer contents are undefined, and > can get copied back later" at the bounce buffer allocation (well, > "mapping") stage. > > Which could cause wasted CPU cycles and isn't great, but should fix > the stale content thing for at least the common "map DMA, do DMA, > unmap" situation. > > What commit aa6f8dcbab47 tried to fix was the "do multiple DMA > sequences using one single mapping" case, but that's also what then > broke ath9k because it really does want to do exactly that, but it > very much needs to do it using the same buffer with no "let's reset > it". > > So I think you're fine to drop ddbd89deb7d3 too, but that commit > doesn't seem *wrong* per se. > > I do think we need some model for "clear the bounce buffer of stale > data", and I do think that commit ddbd89deb7d3 probably isn't the > final word, but we don't actually _have_ the final word on this all, > so stable dropping it all is sane. > > But as mentioned, commit ddbd89deb7d3 can actually fix some cases. > > In particular, I do think it fixes the SG_IO data leak case that > triggered the whole issue. It was just then the "let's expand on this > fix" that was a disaster. Ok, I have just queued that one up now for the older kernels, and the revert for 5.15 and newer, thanks. greg k-h