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 DD974C433E0 for ; Thu, 7 Jan 2021 20:33:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DC812343E for ; Thu, 7 Jan 2021 20:33:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727198AbhAGUdM (ORCPT ); Thu, 7 Jan 2021 15:33:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726073AbhAGUdL (ORCPT ); Thu, 7 Jan 2021 15:33:11 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA3B8C0612F4 for ; Thu, 7 Jan 2021 12:32:30 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id o13so17746163lfr.3 for ; Thu, 07 Jan 2021 12:32:30 -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=JNQFV8i0LQ7ARJJDdSy+KkZ3ZilUiID9pkYIrqDvHdKa/eOdnUry0C++k86LlrB6Vv qmpvllAU3U6NQxxe2/Sgs9oqUmUxquXho+XCxV4/AD075YlhTj+R3uJIZUw4Ck8lsOVj xigv/KlLLi1eiOaxizYC51F0KTFQqOmC6D/b+WoRPvswB27HECHUA+wcNxYz5f8y+28B eAXLN1H/pS6MQXjLGSSsARiiVvrRG5xnz38UY0RA5GVo7uvaxdCypz7x26tWRnccWjVj lsuFmtFM2A+cFFwAob46vYHT7OeGcMSj35Buca9ekpmGDIsRFnjSb3aC4Dw41QoNT04N eW2Q== X-Gm-Message-State: AOAM530V/GuuLLPp8Uwuv5ggnU0cMWqEVN/D1eMrtbLc4OWA58ERU6uR KFZB6z8MlylW8Zp7xBWctdkbSvgD3OFxvA== X-Google-Smtp-Source: ABdhPJxI+YFRh8b3iKJoy5fxXvK0eiY5SCfAo7qjDD1Gqa9R4z2q9+XyL60DyhgA0czrx0eLGoWZRw== X-Received: by 2002:a19:7ec9:: with SMTP id z192mr248483lfc.50.1610051547936; Thu, 07 Jan 2021 12:32:27 -0800 (PST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id j12sm1394049lfc.99.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-f44.google.com with SMTP id m12so17689397lfo.7 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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