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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 12C8EC43460 for ; Wed, 21 Apr 2021 22:59:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4936613E6 for ; Wed, 21 Apr 2021 22:59:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243865AbhDUXAN (ORCPT ); Wed, 21 Apr 2021 19:00:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:60240 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232642AbhDUXAL (ORCPT ); Wed, 21 Apr 2021 19:00:11 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B7162B2F0; Wed, 21 Apr 2021 22:59:36 +0000 (UTC) Subject: Re: [PATCH 0/5] 4.14 backports of fixes for "CoW after fork() issue" To: Suren Baghdasaryan , Linus Torvalds Cc: Mikulas Patocka , Peter Xu , stable , Greg Kroah-Hartman , Jann Horn , Kirill Tkhai , Shaohua Li , Nadav Amit , Linux-MM , Linux Kernel Mailing List , Android Kernel Team , Andrea Arcangeli , David Hildenbrand , Jason Gunthorpe References: <20210401181741.168763-1-surenb@google.com> From: Vlastimil Babka Message-ID: <01f47bcc-ed9d-85c0-2dd1-a7f604d1ad28@suse.cz> Date: Thu, 22 Apr 2021 00:59:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/21/21 10:01 PM, Suren Baghdasaryan wrote: > On Wed, Apr 7, 2021 at 2:53 PM Suren Baghdasaryan wrote: >> >> On Wed, Apr 7, 2021 at 12:23 PM Linus Torvalds >> wrote: >> > >> > On Wed, Apr 7, 2021 at 11:47 AM Mikulas Patocka wrote: >> > > >> > > So, we fixed it, but we don't know why. >> > > >> > > Peter Xu's patchset that fixed it is here: >> > > https://lore.kernel.org/lkml/20200821234958.7896-1-peterx@redhat.com/ >> > >> > Yeah, that's the part that ends up being really painful to backport >> > (with all the subsequent fixes too), so the 4.14 people would prefer >> > to avoid it. >> > >> > But I think that if it's a "requires dax pmem and ptrace on top", it >> > may simply be a non-issue for those users. Although who knows - maybe >> > that ends up being a real issue on Android.. >> >> A lot to digest, so I need to do some reading now. Thanks everyone! > > After a delay due to vacation I prepared backports of 17839856fd58 > ("gup: document and work around "COW can break either way" issue") for > 4.14 and 4.19 kernels. As Linus pointed out, uffd-wp was introduced > later in 5.7, so is not an issue for 4.x kernels. The issue with THPs > is still unresolved, so with or without this patch it's still there > (Android is not affected by this since we do not use THPs with older > kernels). Which THP issue do you mean here? The race that was part of the same Project zero report and was solved by a different patch adding some locking? Or the vmsplice info leak but applied to THP's? Because if it's the latter then I believe 17839856fd58 did solve that too. It was the later switch of approach to rely just on page_count() that left THP side unfixed. > Andrea pointed out that there are other issues and to properly fix > them his COR approach is needed. However it has not been accepted yet, > so I can't really backport it. I'll be happy to do that though if it > is accepted in the future. > > Peter, you mentioned https://lkml.org/lkml/2020/8/10/439 patch to > distinguish real writes vs enforced COW read requests, however I also > see that you had a later version of this patch here: > https://lore.kernel.org/patchwork/patch/1286506/. Which one should I > backport? Or is it not needed in the absence of uffd-wp support in the > earlier kernels? > Thanks, > Suren. > >> >> > >> > Linus >