Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5927222rwr; Mon, 24 Apr 2023 10:55:35 -0700 (PDT) X-Google-Smtp-Source: AKy350atPddkbM1ZN1QUeM9m+Tu4cE8eFByadArnbRJfu060s8VqARLmQuVpQI7YXZijZncal2ea X-Received: by 2002:a17:90b:4f82:b0:247:a68d:7f22 with SMTP id qe2-20020a17090b4f8200b00247a68d7f22mr14888685pjb.4.1682358934463; Mon, 24 Apr 2023 10:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682358934; cv=none; d=google.com; s=arc-20160816; b=ynEc2+UcFFY8bNEsn1/Hmqs7qIYFjFEoFPJ/0f2bbXHMaogP6XXaGdU/GK4e07E9V2 rutsihu18xXxBs1FaCQPq7ZTabwvg44XptiRTPJXn2BnEg0x0uJV038R5Ptnc4N8c7Z1 HizC+sS/f9aUHa4xvXMgXWM7WshImzmOEDcxhn/Uvd8+iyXQWD8geRNp1VPreIOZ69up d3TsWzBLuCWpD/c2HQt0/yRx0kq0Jv4Z8HoNkDuvS4hTfQCnWqjWE5OzLo6iJQSuQrUd weldgHRmV9pYr293F6iHfZpifiF38UcKf4rjOsY0YNtyBPViNg7A54vtd9w9aobCPNH7 51ew== 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=edIyrpOkZxkR7qQPvMEjMBtYXDIPtOhEQ7kSltA2Y7E=; b=aZ0syPAeBu2l2uMAuC4Jsv4qGEST5Wiwo1tEFcfx/TFDi/MFrrm8r9ZS5Hp0l/ur9U q0sDPCBN5GUvf2uEq2PAaMIO8DoXA9YUW7M0G79mpf/t/he07F2m+nni2TmefqczjJ9v M/nbIuu356CyiFD63daX9zFglKB+iSLJReahnQb/neg2RUvF2LNftJhfHqjaYgrnboyq lJooQEA19poOrjIoKTsOR1dkLInd55ltga4SflwGMbEHqBR0DFgBLFSyXNhovt94bqLN FXQYNT7CWM/0m9thndodC8D2J5p2HvRf0lc5IyABi1LK+U79P4IwFXd4fyu2lOpLlPDd iAaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=B0RGu9bS; 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 c7-20020a17090ad90700b002473c0c9fe9si14317828pjv.50.2023.04.24.10.55.19; Mon, 24 Apr 2023 10:55:34 -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=@ziepe.ca header.s=google header.b=B0RGu9bS; 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 S231332AbjDXRtl (ORCPT + 99 others); Mon, 24 Apr 2023 13:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231134AbjDXRtk (ORCPT ); Mon, 24 Apr 2023 13:49:40 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 827936A78 for ; Mon, 24 Apr 2023 10:49:38 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-63b57c49c4cso4071625b3a.3 for ; Mon, 24 Apr 2023 10:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1682358578; x=1684950578; 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=edIyrpOkZxkR7qQPvMEjMBtYXDIPtOhEQ7kSltA2Y7E=; b=B0RGu9bSAOqeQFKM2kCfJoKnl08Vl+oe+fwmnFVAivzg30GMkKXPEJIoCB0NsHbaMh y1QOEsnnYJO/COyfiUTW2dtgpEZrqz2vLI1HRdIkW9hABd7zQuI3eeVtbR5A2iA6mCaV 5QBQkDfq+xdn7BOEA9dEj6QIjjHMU11j/zgdaVZsVhi8C2oRl6bFxT6thxHV49P2U8UL zYC+DjT2f/NHcPLoSAHdcnqWWaY/yPWwMTsi+NOz2XxNjs9qrmO2DZcxaSVTMPKUaaw8 WFfpAud6lL6IcXM5+aRHmp/yuX4VH+U0aJ4N7MhsIExmp9g+j5ts12kN96no48OTOYsl BwRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682358578; x=1684950578; 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=edIyrpOkZxkR7qQPvMEjMBtYXDIPtOhEQ7kSltA2Y7E=; b=M8bTMpTqbZsvj8EZOoGz6ib0X1FlxUO/7vLCkjlfRuWENks9IJvCZ0SBv3IJa4l6bY i+LzxieSgqV7h9p6SO0NO8KeBXIQ2YFEloLL+nApomka5tsVd0uys9N/RucAYDXXMnT4 g3QH0HU7YcEhhrO65CZqHSyBzhoelb5QPXyUZqKqIMtfo1gTK3JRx6kIdrHjXIY811SJ 9J3OPcIuH7+YNid2eMl4CSMnGxpkLVYkU0Sim370k7bJsGB4m/ExkHNie9yPFb3i0a2e W5nqXhQMV5DyDW/HjbF1pypaq6Lxxf0s7KYwYIco8i9hkjDcHdM7Ez5u9MzVhM4OvgmW 82qA== X-Gm-Message-State: AAQBX9fAbBOesxMsGD90vruU9B8l+QmZGvIvnxqkYDcfJtUt/VWAfLmv nA9ixePPUW5lcbQ7g7Re0LkAgA== X-Received: by 2002:a05:6a20:269f:b0:f0:7b8:c77b with SMTP id h31-20020a056a20269f00b000f007b8c77bmr14185926pze.59.1682358578033; Mon, 24 Apr 2023 10:49:38 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id b6-20020a63d806000000b005143d3fa0e0sm6814788pgh.2.2023.04.24.10.49.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 10:49:37 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1pr0Jj-001Vpp-HL; Mon, 24 Apr 2023 14:49:35 -0300 Date: Mon, 24 Apr 2023 14:49:35 -0300 From: Jason Gunthorpe To: Lorenzo Stoakes Cc: Dave Chinner , 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 Subject: Re: [PATCH] mm/gup: disallow GUP writing to file-backed mappings by default Message-ID: References: <20230423222941.GR447837@dread.disaster.area> <14c6f0f3-0747-4800-8718-4f109f7321ea@lucifer.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14c6f0f3-0747-4800-8718-4f109f7321ea@lucifer.local> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, Apr 23, 2023 at 11:56:48PM +0100, Lorenzo Stoakes wrote: > This warned upon check should in reality not occur, because it implies the > GUP user is trying to do something broken and is _not_ explicitly telling > GUP that it knows it's doing it and can live with the consequences. And on > that basis, is worthy of a warning so we know we have to go put this flag > in that place (and know it is a source of problematic GUP usage), or fix > the caller. It is fine for debugging, but we can't merge user triggerable WARN_ONs.. Since the GUP caller has no idea if userspace might be maliciously passing in a file VMA we can't throw warnings. Jason