Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1812569rwd; Wed, 17 May 2023 01:31:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wV58xIbhZfZDxbhp0gsu10WLXJQt+pYSj7dWhMJA27up6V6iGNflC9NG7tkpcnC1QUpfX X-Received: by 2002:a05:6a20:3c8c:b0:100:fe72:0 with SMTP id b12-20020a056a203c8c00b00100fe720000mr36812045pzj.43.1684312279853; Wed, 17 May 2023 01:31:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684312279; cv=none; d=google.com; s=arc-20160816; b=NH7C32JTZJt0B7jfTjF8+2USMuHE+hsLB4Vt1PBxIkULUp1i6PpiXQVEU7rZd2b02t A0ff1fUQp9iF2TlbP1WZhereW3+XLEzlwbM6Jm0Dk4lllRWLrP+eumxsjQLEHLDOe5D7 dH2p+KZQUGSXyX0p9mH26nT5zq7H6hKK9ZqzShv0Kqv5C8vJTXt1BRVzrDPAQqzlTZCO +HEZTayW0AUzXnPf+ZcXa/P4i4EsNgCzAWRqjK1bypNokMJg9u5+eUOfCnmHSkOfQRuk 9Qc41qwir6vFOAx/lapDv5pn93zgdmD9losX/z+UEH+Vcgkk2/GlIsb8VcJbuflosyVf SKHQ== 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=DTmEEM/+QduNUnxg8gEx0EXzPjAs6x+04O4FYgiiAdQ=; b=ADyZKabPpYLGiftESsFQsIkwjLS3Pi9acP85TnrIBo5UzOKAZetONi4tuYOwe5+1Xu NwP9+noJPztY+4UyXjVX8H1xJaJ5/AUmeuWXYxoXl5yDNaq/I4xcPd4r522i/p2F+qKv vngw0sOlC2vcJFVr8cyRIqDch0VLdTqBhODBeKhUmCtj6Os/Kd9kjThpG3CvBJOaPZCH cB7tQK/MHnPsYXJxBjGYImolUMOHM9qMaqFMhqcB37Rp2n4KBfEYrovE96PPAXplIFhv qemIS7ca7kKp/wY+fTUd+iR+o8IlG8Cuw5Spza/MnrlQfeAgbFcnJoJZm6OY9a7KRz4S 3nMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=RdAX2d2X; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m2-20020a637d42000000b005306facab05si15358901pgn.120.2023.05.17.01.31.08; Wed, 17 May 2023 01:31:19 -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=@infradead.org header.s=bombadil.20210309 header.b=RdAX2d2X; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229849AbjEQIKl (ORCPT + 99 others); Wed, 17 May 2023 04:10:41 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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.