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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 8D81DC433ED for ; Wed, 21 Apr 2021 20:01:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 118F360698 for ; Wed, 21 Apr 2021 20:01:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 118F360698 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 697246B0036; Wed, 21 Apr 2021 16:01:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66DD36B006E; Wed, 21 Apr 2021 16:01:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 510696B0070; Wed, 21 Apr 2021 16:01:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id 358616B0036 for ; Wed, 21 Apr 2021 16:01:47 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DC4FD181E490E for ; Wed, 21 Apr 2021 20:01:46 +0000 (UTC) X-FDA: 78057444612.11.E82CD0A Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) by imf03.hostedemail.com (Postfix) with ESMTP id 02D0CC0007D3 for ; Wed, 21 Apr 2021 20:01:41 +0000 (UTC) Received: by mail-yb1-f171.google.com with SMTP id 82so48629601yby.7 for ; Wed, 21 Apr 2021 13:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=N25SjpwU7jt3YRnEr3GAIUXkZUK/W3lOm1cYE1CKpNY=; b=G7JYVKHjK6F2HUO6B+H/oniSDXpZCAbY6/ho8+v+7JRI1O7sVMjJG/E2nCFROq5VAP +Jt7jLWKKZBfOwWgvgqy8Ur/t5ajGyAgwyLpElgr4TjYopQl7dHBJE4da6V4HGshitmW gbP81GI1ewkJa3zZLvG6xegeMt/5R0rm+yybtswjGH2Kmsfha998wgHtXHHWtKneBBQT HETYMqY+rFcm5ZFosLVKAun4cMDUVO1HwTDvICbago+LXQm0SgV1xivHgbL505g3j0Zf XrtShRPqu6kbRzPysQJxwGhcnAvgtqcW8DwlTpcsxH7PcE/u9Gcx8WbVYudRisMwf7MM pk5Q== 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=N25SjpwU7jt3YRnEr3GAIUXkZUK/W3lOm1cYE1CKpNY=; b=Xc7ACu4Wxdn/Puduw7k0cLlyXTHdY/f8uMXBRiSY+pBVpyCBBIWh1sg2lvANN+VE4V oyu6ay/dAwa392lmx/EyXB0ZaImFCOrdm6pnc15DQEjSXI7mNqakQrCNPbOwfS+nl0FT F6ugK4uYSyF569bAAPkjCm/Z+0AhjUDsT6va3QPwGKMQ++YptrZ5Rp2DQ1LvXABd6jVx tWTMVj2QmDSDEhYbwX+3vgKZ+ouc++PLi+Nkrvi81jvzkNa3ytdCagBbAcF083PKoHB6 rXjdDhfky0F3r0OwE5cujHMB2KcUI39gMZA01s0cJ3bgfWGKJ/MXQcLfBuumlD59dBFc +R+w== X-Gm-Message-State: AOAM531HQ+W3ZudwdbzEvwza20dyQrHyB9sZST2JEZKZPnjSfD8oMa+R QBlyfnEL/doKGcs6Qn6d8CWdQdSet1NSINkYb2cS1w== X-Google-Smtp-Source: ABdhPJxQawgMOAh8U7mORlWyVS1yUZDsWs9dCsjLPG9HijkOotn83qeRYhVGs7QfLaIKXNmHvhQBKIT8OxVw9st4uGc= X-Received: by 2002:a5b:7c5:: with SMTP id t5mr34532781ybq.190.1619035305484; Wed, 21 Apr 2021 13:01:45 -0700 (PDT) MIME-Version: 1.0 References: <20210401181741.168763-1-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Wed, 21 Apr 2021 13:01:34 -0700 Message-ID: Subject: Re: [PATCH 0/5] 4.14 backports of fixes for "CoW after fork() issue" To: Linus Torvalds Cc: Mikulas Patocka , Vlastimil Babka , 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 Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 02D0CC0007D3 X-Stat-Signature: bcmqbynncbmsgtnmcds4yhcwwwhwgmdt Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf03; identity=mailfrom; envelope-from=""; helo=mail-yb1-f171.google.com; client-ip=209.85.219.171 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619035301-664981 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 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). 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