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 8883BC7EE2A for ; Wed, 17 May 2023 08:10:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230203AbjEQIK0 (ORCPT ); Wed, 17 May 2023 04:10:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230147AbjEQIKY (ORCPT ); Wed, 17 May 2023 04:10:24 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7DD510EF; Wed, 17 May 2023 01:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=DTmEEM/+QduNUnxg8gEx0EXzPjAs6x+04O4FYgiiAdQ=; b=RdAX2d2XiqRvKxl2rKOGWzP4uK jRMB6DlSpFvBHfPwXiFTnREXMRvZIa5vr9f+gheMapnqq4nwfC2b6p5bhhbus/OlCtASE4Ek2elUO 8GI3PuGvzy06pzPsguJHueg+BCCz0i6mWoY7F4ScVr8GnLeZ82DnAedMyOfIQs8SFXX6PnA7c5H2G hJD8j5BpWjJ5ZQw0C0h1lV0VgyGju5Q0HBaPOZoAtiXKQX/J5THbxD/TLpDfiRnyh8O7Uujygh0YI YZJ9K6yRQPpYU2m2mrMqPUp7c1Xe5xU1To/+dbrYoiqE7CO0CMJKS3W3CZzsCiqhHLOU1JmqfXDw1 5gYHPBMg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pzCEj-008nbM-21; Wed, 17 May 2023 08:10:17 +0000 Date: Wed, 17 May 2023 01:10:17 -0700 From: Christoph Hellwig To: Lorenzo Stoakes Cc: Christoph Hellwig , Jan Kara , Jason Gunthorpe , "Kirill A . Shutemov" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Jens Axboe , Matthew Wilcox , Dennis Dalessandro , Leon Romanovsky , Christian Benvenuti , Nelson Escobar , Bernard Metzler , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Bjorn Topel , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christian Brauner , Richard Cochran , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Oleg Nesterov , John Hubbard , Pavel Begunkov , Mika Penttila , David Hildenbrand , Dave Chinner , Theodore Ts'o , Peter Xu , Matthew Rosato , "Paul E . McKenney" , Christian Borntraeger Subject: Re: [PATCH v9 0/3] mm/gup: disallow GUP writing to file-backed mappings by default Message-ID: References: <20230515110315.uqifqgqkzcrrrubv@box.shutemov.name> <7f6dbe36-88f2-468e-83c1-c97e666d8317@lucifer.local> <20230517072920.bfs7gfo4whdmi6ay@quack3> <503e92f9-fbc2-422b-b0d4-f4cabe3f6802@lucifer.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <503e92f9-fbc2-422b-b0d4-f4cabe3f6802@lucifer.local> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On Wed, May 17, 2023 at 08:55:27AM +0100, Lorenzo Stoakes wrote: > I'll try to take this in good faith because... yeah. I do get that, I mean > I literally created a repro for this situation and referenced in the commit > msg and comments this precise problem in my patch series that > addresses... this problem :P > > Perhaps I'm not being clear but it was simply my intent to highlight that > yes this is the primary problem but ALSO GUP writing to ostensibly 'clean' > pages 'behind the back' of a fs is _also_ a problem. Yes, it absolutely is a problem if that happens. But we can just fix it in the kernel using the: lock_page() copy data set_page_dirty_locked() unlock_page(); pattern, and we should have covere every place that did in tree. But there's no good way to verify it except for regular code audits.