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 6A0EFC433ED for ; Wed, 21 Apr 2021 23:05:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD078613F6 for ; Wed, 21 Apr 2021 23:05:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD078613F6 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 C565A6B006C; Wed, 21 Apr 2021 19:05:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C06E06B006E; Wed, 21 Apr 2021 19:05:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA7F76B0070; Wed, 21 Apr 2021 19:05:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0195.hostedemail.com [216.40.44.195]) by kanga.kvack.org (Postfix) with ESMTP id 923D86B006C for ; Wed, 21 Apr 2021 19:05:35 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4A80C181F110A for ; Wed, 21 Apr 2021 23:05:35 +0000 (UTC) X-FDA: 78057907830.06.1EF2BD8 Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) by imf07.hostedemail.com (Postfix) with ESMTP id BFE8AA0003A3 for ; Wed, 21 Apr 2021 23:05:34 +0000 (UTC) Received: by mail-yb1-f172.google.com with SMTP id x76so39110120ybe.5 for ; Wed, 21 Apr 2021 16:05:34 -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=NEm8gM/fSFaOWMqgyzI8qdXody5lDepUX4v4tPFO86g=; b=KoOKl0PZnkPYe4SbhkaZQMToH15XqcFEE8rWO4Qhmv2eaa+W9fr2mthitUxLXVJ2DH OV+v9u4Klp87pG+hFBzsX2EViQ79xaZEtq0X31P409NbL5DeB8lKDdl762/BhZ0oMOub UTHQkikHjwVWJOPjMjYHJ6VtrL2unlmZbRE6aCwioGmcRE6QhS1CpUBaON7HMRT7kB95 KC3GSmnkPxMKYy7gosgBEmszbBxF4iI56jcyJoJUliH67juEnHThej112XIOlbp1YyB2 TzMZRIPXo6xc5DQTEy1kE/fR3ys98BxZSWKHDzRs+RE+3Lr7fDJ7J/d+nJdqEXVAff0W cZ1g== 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=NEm8gM/fSFaOWMqgyzI8qdXody5lDepUX4v4tPFO86g=; b=LiBfoDdszxUoKgN4KvqJlgr1mN0h44yALlBFwKJX33XlpTE1scKHFqy7kIEqVuhl4g OQqMdBlbbQgOSAy3sUh7Zwh1+HA4n7i2M/+zIxgOUsaJr3JUcriJzGbjwqkTd4wo1Vpf 88BkfE97TZU0jilJ7fGaPDLtIjuoiS8/t8U3bJYfBcUk2gTkYBfof2OzQBtAgSPHk8XE 0KzJyLJHvSLp9u6FaFRzWifSfUMH/xZDjsHvz/SuDmzZN3rhqWum934RaNVA32wuRGBH MFD9ARvqKEtka9PAABUkOkv6MLl9ZrUZcSE/KnWdiBQFT/u83VDocJac3EH3nwF1f4CF mqYg== X-Gm-Message-State: AOAM530YDtzZS9BsC1xKMieuPVmG+EaZs6YBMnlnq9rJjqEEau/FeUuP 15ss+YI4zfOZhHmPXYKqVlcQuRCMB8e98EthTA6qeA== X-Google-Smtp-Source: ABdhPJyKbZa8U1MlpCzEY3rcgzVqE0BZYxwai22fqQrt69eElmxl+gpvB70oKTySO29O1LJPigy4RIGEBwDeFrfQz6c= X-Received: by 2002:a25:dc02:: with SMTP id y2mr523853ybe.23.1619046334091; Wed, 21 Apr 2021 16:05:34 -0700 (PDT) MIME-Version: 1.0 References: <20210401181741.168763-1-surenb@google.com> <01f47bcc-ed9d-85c0-2dd1-a7f604d1ad28@suse.cz> In-Reply-To: <01f47bcc-ed9d-85c0-2dd1-a7f604d1ad28@suse.cz> From: Suren Baghdasaryan Date: Wed, 21 Apr 2021 16:05:23 -0700 Message-ID: Subject: Re: [PATCH 0/5] 4.14 backports of fixes for "CoW after fork() issue" To: Vlastimil Babka Cc: Linus Torvalds , 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 Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: BFE8AA0003A3 X-Stat-Signature: ww91nk7b6zazix3pguju3k188bhk5cdu X-Rspamd-Server: rspam02 Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf07; identity=mailfrom; envelope-from=""; helo=mail-yb1-f172.google.com; client-ip=209.85.219.172 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619046334-556090 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 21, 2021 at 3:59 PM Vlastimil Babka wrote: > > 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. I meant the "vmsplice info leak applied to THP's" but now I realize that 17839856fd58 does not use elevated reference count, so indeed that should not be a problem. Thanks for the note! > > > 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 > > >