Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1886253rwd; Mon, 15 May 2023 04:38:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4F8kigg4tFTMEbXJ59eUVWRd5rYTBLOwtDeccNphx/Xvr8BQCWf+c38TxRI20Q02nC5Xku X-Received: by 2002:a05:6a20:442a:b0:ff:68f1:679 with SMTP id ce42-20020a056a20442a00b000ff68f10679mr41254768pzb.52.1684150689605; Mon, 15 May 2023 04:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684150689; cv=none; d=google.com; s=arc-20160816; b=UsTrndlgbw+7BGM0jVVFM6F8GU6EWZ5CdVzkLrKcdAFkasRMHgUWroUMvH30BcPM7a 6eFw3ZuhZ6db0GHg5r7krvZDlSKrjuDMdIqUwrSbezODcU/YuEdw5khYzR68vJZEvXPl +3bBJVVBh1a3SV3KVUhVLdCFyQcqpcJdoXr3JqkXHSUwuC0P1ORiQG6Y2Agd8pMNbrXb LxFpi0ygC/CRZYqCvIQPOZx0xWl+CG+Kbi6KYfkW2ryjsVSbuNBbrJDcRH36LtnQFTk3 12WiItepaGy8w28DXG0xEl2YnAfDtDIUA+qnOIi/BEiXls+qNy8fbj4YSXzijOFcDkls bftg== 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=vvfV0sEFtRCF/8ZbA1b9yt0/e64L7RJ3L0AI8zLMm9I=; b=s+k12+AWPaiqvxyzUWp40ZCYHj1b37KLWygbTd3RHJgtlZ6guSD6TLUVFTcg17PnTH T8IEgpT6thiqEjIP5vFZU07rf3oU6inkisOcduloTTBnA4KwuLu0fkTKDP4tMje28kTZ C0XZA8xdk77QFiD5zzbNhyF7K6H374uLHs2RPT7My1xnac9z9ggZQCeEUZxptjc3Y0yW q4OGaekGaf9Cg8Q7uLbdlgbN++WhCFcD5/QV6gcjko5AdsYuEMBf3qxt8eNbxj+09kWh icsg1LrIdyHEGgSLb13+Y9HXFWOw8FpIXr0NicruMjm+yhfESl1OGwfkQExoEJUpsHI4 9WjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=kPjpVmks; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k62-20020a638441000000b00533ffeaca3bsi3681000pgd.275.2023.05.15.04.37.40; Mon, 15 May 2023 04:38: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=@gmail.com header.s=20221208 header.b=kPjpVmks; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbjEOLcA (ORCPT + 99 others); Mon, 15 May 2023 07:32:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241241AbjEOLb7 (ORCPT ); Mon, 15 May 2023 07:31:59 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0518138; Mon, 15 May 2023 04:31:55 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-965f7bdab6bso2222322866b.3; Mon, 15 May 2023 04:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684150314; x=1686742314; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vvfV0sEFtRCF/8ZbA1b9yt0/e64L7RJ3L0AI8zLMm9I=; b=kPjpVmksuf9oAOejRIjWtY9929N374P+GeBpuGDe9iZWM2wPxC/p7NH6UEF5CISwH4 jbUJRuyomH2kG/yCIN+G9SheAr2hkP2YMdk0OxcEvVYwkJGttFgvtC7xpQGR6CB3GgKo mBkuqwLXnswyAkUiZe3Pb6f9p2sS9PuFyWzDFq68Xo6/Ss+7ngAKnr/qYPzt18rawGCm GHur/KAmxb8a/zFus0h5gVJmVgcTT5V16E7PmlkWqFq66Qnr4jGrFF3uKVuyXZJqDOfy 7MZ0mjag4BxFqnNTV1u51azqbFpO3Pe7MRPdRD7Vr+VDJWy2LDZGy7rNOKFtseSEylK2 da1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684150314; x=1686742314; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vvfV0sEFtRCF/8ZbA1b9yt0/e64L7RJ3L0AI8zLMm9I=; b=TIsyANi821eRhJysbtGmFa5LO20worihSRmxLwqJsfOgranq/DqoJ8ilW3dLatb2Bh kfltPVnTkuRO78Pp4QPO0ZesXSklwuqD9PR39y/1QmonKWF6sdqgjbzPiTOQFBNKutvu by1q1lMGy2lHFiEVXRAMuMUgV7U94DmVPtUD/UL5zMtLRRqZEz0tXAlRuOEk0TNusG6m DvJTpT7corv/O/ypOJ32quYpYdATXIfvaedW07mTPiFVQFZnnsOy8pY3FEXW/7TT3wpN QPoJ9Gz02c+HIfIj0N9UU++he/Q0LUszMy7fcLTWhzJxMcPy1+zwNBWOKEycErI4JM66 7S7A== X-Gm-Message-State: AC+VfDzmu4oZc84054NXLvQlvime83wQuRQNrxZH0uSs16q34ov5SB3R dBFnJUOhbJWX2osj5IJLla8= X-Received: by 2002:a17:906:58c5:b0:966:58ad:d934 with SMTP id e5-20020a17090658c500b0096658add934mr26454295ejs.0.1684150313896; Mon, 15 May 2023 04:31:53 -0700 (PDT) Received: from localhost ([31.94.21.70]) by smtp.gmail.com with ESMTPSA id hz20-20020a1709072cf400b0094f4d2d81d9sm9303913ejc.94.2023.05.15.04.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 04:31:53 -0700 (PDT) Date: Mon, 15 May 2023 12:31:51 +0100 From: Lorenzo Stoakes To: Christoph Hellwig Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Jason Gunthorpe , 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 , Jason Gunthorpe , John Hubbard , Jan Kara , "Kirill A . Shutemov" , 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: <59c47ed5-a565-4220-823c-a278130092d5@lucifer.local> References: <0eb31f6f-a122-4a5b-a959-03ed4dee1f3c@lucifer.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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, May 14, 2023 at 10:14:46PM -0700, Christoph Hellwig wrote: > On Sun, May 14, 2023 at 08:20:04PM +0100, Lorenzo Stoakes wrote: > > As discussed at LSF/MM, on the flight over I wrote a little repro [0] which > > reliably triggers the ext4 warning by recreating the scenario described > > above, using a small userland program and kernel module. > > > > This code is not perfect (plane code :) but does seem to do the job > > adequately, also obviously this should only be run in a VM environment > > where data loss is acceptable (in my case a small qemu instance). > > It would be really awesome if you could wire it up with and submit it > to xfstests. Sure am happy to take a look at that! Also happy if David finds it useful in any way for this unit tests. The kernel module interface is a bit sketchy (it takes a user address which it blindly pins for you) so it's not something that should be run in any unsafe environment but as long as we are ok with that :)