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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CCFAC433E0 for ; Thu, 7 Jan 2021 20:32:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E52BD2343F for ; Thu, 7 Jan 2021 20:32:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E52BD2343F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2A1478D0149; Thu, 7 Jan 2021 15:32:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 22C2A8D013A; Thu, 7 Jan 2021 15:32:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0CBE98D0149; Thu, 7 Jan 2021 15:32:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id E695D8D013A for ; Thu, 7 Jan 2021 15:32:29 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A1978824556B for ; Thu, 7 Jan 2021 20:32:29 +0000 (UTC) X-FDA: 77680126818.02.debt71_52003bd274ed Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 86B9910097AA2 for ; Thu, 7 Jan 2021 20:32:29 +0000 (UTC) X-HE-Tag: debt71_52003bd274ed X-Filterd-Recvd-Size: 4855 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 Jan 2021 20:32:28 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id h22so17776534lfu.2 for ; Thu, 07 Jan 2021 12:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=exdNoEK6aNVTIIvwBb552yhewWQizCMJvF9WzrX9jnw=; b=D2InA4ogLKOyCTV7NlZA4RiumoSXVMs9ntzahvPQMp4OQpQM96X0jajm3v+5LBd+6V dcoiw9TSyMMWbMbJAdUzTtk46W7QnhZWTW8BEnO7/8+YZfyERLDEnVshc67mBo+/e9h5 irxASrqJdCjrw7OvErf1/1EFk61vrF1uPi45Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=exdNoEK6aNVTIIvwBb552yhewWQizCMJvF9WzrX9jnw=; b=NjPQs1VW97Movwr50vbx2teVteEDE95e+ywt/hApNEmzYAEc7J2qedkBc7ji7xucuq akBb5TtQCrSv/TX555pXm53Cu4gKmzobTn1i5yzfzekr7KfLWt/ArX7K4FjGxQ3hQtj9 /s6nKdNDyJT1A4sOsRFlQTinOqfQqGNaEFVOp/2n8rh2fXSK2KhBkhieATGkcGagU2eu J6EupmXrN4Wcum2o7uqQuloROGhu1XhHNkVdi0/xn6PdhREEjbqx6IG8OX4M4HAjXK9s bkkZpd0FNDdmr0oH2QISys4LWZGCyjMr71rFEhEEh0wGTk7dCn+pFYDGlfcl2w/sOaWF glWg== X-Gm-Message-State: AOAM530XgW5O7lBGmAFhPzKlQBxZIghpJ7e/2uYDEoMEXeSdBvsWtwQb w7YG1z77RTy4B8lkHFp+vT6S48N/uw7bDA== X-Google-Smtp-Source: ABdhPJxXWKvs1KO06sYt0RbewE1hPHz00Su6/wmXKlvzJDl5o9BibC4NR6USy8U1AEbuDWVAaecwgg== X-Received: by 2002:ac2:5bc2:: with SMTP id u2mr212744lfn.565.1610051547332; Thu, 07 Jan 2021 12:32:27 -0800 (PST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id o138sm1394517lfa.171.2021.01.07.12.32.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 12:32:26 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id 23so17635208lfg.10 for ; Thu, 07 Jan 2021 12:32:26 -0800 (PST) X-Received: by 2002:ac2:4987:: with SMTP id f7mr194200lfl.41.1610051545800; Thu, 07 Jan 2021 12:32:25 -0800 (PST) MIME-Version: 1.0 References: <20210107200402.31095-1-aarcange@redhat.com> <20210107202525.GD504133@ziepe.ca> In-Reply-To: <20210107202525.GD504133@ziepe.ca> From: Linus Torvalds Date: Thu, 7 Jan 2021 12:32:09 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/2] page_count can't be used to decide when wp_page_copy To: Jason Gunthorpe Cc: Andrea Arcangeli , Linux-MM , Linux Kernel Mailing List , Yu Zhao , Andy Lutomirski , Peter Xu , Pavel Emelyanov , Mike Kravetz , Mike Rapoport , Minchan Kim , Will Deacon , Peter Zijlstra , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Oleg Nesterov , Jann Horn , Kees Cook , John Hubbard , Leon Romanovsky , Jan Kara , Kirill Tkhai Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jan 7, 2021 at 12:25 PM Jason Gunthorpe wrote: > > Lots of places are relying on pin_user_pages long term pins of memory, > and cannot be converted to notifiers. > > I don't think it is reasonable to just declare that insecure and > requires privileges, it is a huge ABI break. Also, I think GUP (and pin_user_pages() as a special case) is a lot more important and more commonly used than UFFD. Which is really why I think this needs to be fixed by just fixing UFFD to take the write lock. I think Andrea is blinded by his own love for UFFDIO: when I do a debian codesearch for UFFDIO_WRITEPROTECT, all it finds is the kernel and strace (and the qemu copies of the kernel headers). Does the debian code search cover everything? Obviously not. But if you cannot find A SINGLE USE of that thing in the Debian code search, then that is sure a sign of _something_. Linus