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,URIBL_BLOCKED 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 B7993C433B4 for ; Thu, 1 Apr 2021 18:59:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3C2CC60230 for ; Thu, 1 Apr 2021 18:59:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C2CC60230 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 A7BC56B0070; Thu, 1 Apr 2021 14:59:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9DA4F6B0072; Thu, 1 Apr 2021 14:59:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8534D6B0073; Thu, 1 Apr 2021 14:59:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0252.hostedemail.com [216.40.44.252]) by kanga.kvack.org (Postfix) with ESMTP id 3571E6B0070 for ; Thu, 1 Apr 2021 14:59:23 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E0EC3DB32 for ; Thu, 1 Apr 2021 18:59:22 +0000 (UTC) X-FDA: 77984711364.27.79DDC5C Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by imf14.hostedemail.com (Postfix) with ESMTP id 6959DC0001FA for ; Thu, 1 Apr 2021 18:59:20 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id r193so280037ior.9 for ; Thu, 01 Apr 2021 11:59:22 -0700 (PDT) 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=LTrV/slVNcOkclb52d6/XH5+RZLu+eLYQgE7tTk9jm8=; b=XqoN1J3OfCjIrC0KWqrkgQ4DHvlDvGlYbtGG6DwF8z4jqeqPjQ1wpeF1fBeQsk8Od9 YkUQRF3ovgwy4aaADuNf66LgpJIfpfyEmaVzlL/9XTx8Z/9sLBkqco+k5KxHi74jEIQZ 72DMM9iMns8rRBgUeb6W3OyJCjDnuFyIiDThI= 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=LTrV/slVNcOkclb52d6/XH5+RZLu+eLYQgE7tTk9jm8=; b=AYOYRenoEjf/I8DAXa8Z03mYgXAgc2sCLhB4RphflmqexOej3CxLF3+1FqG9rj1XWM XH7EnXbsxPjz7yLo81R/g1cocQ8jzVHkiwaJKCXZ+haH8UijwYUM+TrW8kflo8DNJrGs BovDHRr761Ozb2q4Os9DFr9u68jurqII/dzFsP9MIFK9kmvgMLzBrXnxyiA+Zq65GEVY HKCLmnKq446UwfmohCgnM+Z4vUuMlwo2upSZ7bLh+WCCLZ6HfWywWB92i/L4hDq83X+y APdj6LeBo3Hld/y/Th1K4l+2QnhBwxAfNg5JatF4ucH7lo2K7BC9h7koDIbgXovdw1Td laYQ== X-Gm-Message-State: AOAM531Rm59BSVaGHycz2pkNsW+4I0cOpM84KjZTUVW54IKN/Zd8oHII eLp5rDz5aFEfHL21YweKKCkvKb+jNcH5vA== X-Google-Smtp-Source: ABdhPJxnT95o588XvOMHbAa8/C0dbjFmAshiwaolwwCWzpHVmctv84TYO1htMhS2uJxe8FWWj3HFxw== X-Received: by 2002:a05:6602:2056:: with SMTP id z22mr7999235iod.21.1617303560838; Thu, 01 Apr 2021 11:59:20 -0700 (PDT) Received: from mail-il1-f172.google.com (mail-il1-f172.google.com. [209.85.166.172]) by smtp.gmail.com with ESMTPSA id w11sm2881833ill.36.2021.04.01.11.59.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Apr 2021 11:59:19 -0700 (PDT) Received: by mail-il1-f172.google.com with SMTP id t14so2926130ilu.3 for ; Thu, 01 Apr 2021 11:59:19 -0700 (PDT) X-Received: by 2002:a05:6e02:20ee:: with SMTP id q14mr7590690ilv.223.1617303559149; Thu, 01 Apr 2021 11:59:19 -0700 (PDT) MIME-Version: 1.0 References: <20210401181741.168763-1-surenb@google.com> In-Reply-To: <20210401181741.168763-1-surenb@google.com> From: Linus Torvalds Date: Thu, 1 Apr 2021 11:59:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/5] 4.14 backports of fixes for "CoW after fork() issue" To: Suren Baghdasaryan , Peter Xu Cc: stable , Greg Kroah-Hartman , Jann Horn , Kirill Tkhai , Shaohua Li , Nadav Amit , Linux-MM , Linux Kernel Mailing List , Android Kernel Team Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6959DC0001FA X-Stat-Signature: 1g8b84kfhspcrgyrbqje18uwdoyan4jt Received-SPF: none (linuxfoundation.org>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=mail-io1-f48.google.com; client-ip=209.85.166.48 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617303560-932116 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, Apr 1, 2021 at 11:17 AM Suren Baghdasaryan wrote: > > We received a report that the copy-on-write issue repored by Jann Horn in > https://bugs.chromium.org/p/project-zero/issues/detail?id=2045 is still > reproducible on 4.14 and 4.19 kernels (the first issue with the reproducer > coded in vmsplice.c). Gaah. > I confirmed this and also that the issue was not > reproducible with 5.10 kernel. I tracked the fix to the following patch > introduced in 5.9 which changes the do_wp_page() logic: > > 09854ba94c6a 'mm: do_wp_page() simplification' The problem here is that there's a _lot_ more patches than the few you found that fixed various other cases (THP etc). > I backported this patch (#2 in the series) along with 2 prerequisite patches > (#1 and #4) that keep the backports clean and two followup fixes to the main > patch (#3 and #5). I had to skip the following fix: > > feb889fb40fa 'mm: don't put pinned pages into the swap cache' > > because it uses page_maybe_dma_pinned() which does not exists in earlier > kernels. Because pin_user_pages() does not exist there as well, I *think* > we can safely skip this fix on older kernels, but I would appreciate if > someone could confirm that claim. Hmm. I think this means that swap activity can now break the connection to a GUP page (the whole pre-pinning model), but it probably isn't a new problem for 4.9/4.19. I suspect the test there should be something like /* Single mapper, more references than us and the map? */ if (page_mapcount(page) == 1 && page_count(page) > 2) goto keep_locked; in the pre-pinning days. But I really think that there are a number of other commits you're missing too, because we had a whole series for THP fixes for the same exact issue. Added Peter Xu to the cc, because he probably tracked those issues better than I did. So NAK on this for now, I think this limited patch-set likely introduces more problems than it fixes. Linus