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=-7.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 15A25C6377D for ; Thu, 22 Jul 2021 14:05:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A80176135F for ; Thu, 22 Jul 2021 14:05:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A80176135F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 422556B005D; Thu, 22 Jul 2021 10:05:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D2C36B006C; Thu, 22 Jul 2021 10:05:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C0956B0071; Thu, 22 Jul 2021 10:05:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0113.hostedemail.com [216.40.44.113]) by kanga.kvack.org (Postfix) with ESMTP id 0F8286B005D for ; Thu, 22 Jul 2021 10:05:07 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BB6032040E for ; Thu, 22 Jul 2021 14:05:06 +0000 (UTC) X-FDA: 78390395412.29.74F9416 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf15.hostedemail.com (Postfix) with ESMTP id 601EAD0000B9 for ; Thu, 22 Jul 2021 14:05:06 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id EE4366128A; Thu, 22 Jul 2021 14:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626962705; bh=HQV3ltpdioq332rYU8MEJmqXRNGg6NdmH1xEjz8aR4U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z7JSVXsi1oU841lt24JeiDTQzvl9R/UX0GUoun33l7BcsCE6FDp3IqesLm5iMAfMX Ahu+uU8fAbUpCSmpLlshrTyp0eN6rwFjrf6NAiqJwOqH2KP7jiJuC+he6eVvqtztXO 1OeTb0yRjxr51xP50yrlhmApOo3y29Kq/d8bKPmU= Date: Thu, 22 Jul 2021 16:05:02 +0200 From: Greg KH To: Hugh Dickins Cc: Peter Xu , stable , linux-kernel , linux-mm , Igor Raits , Hillf Danton , Axel Rasmussen , Andrew Morton Subject: Re: [PATCH stable 5.10.y 0/2] mm/thp: Fix uffd-wp with fork(); crash on pmd migration entry on fork Message-ID: References: <796cbb7-5a1c-1ba0-dde5-479aba8224f2@google.com> <20210720155657.499127-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 601EAD0000B9 X-Stat-Signature: xys57gk7zoq5cy6e64au9farqhz8utgq Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=Z7JSVXsi; spf=pass (imf15.hostedemail.com: domain of gregkh@linuxfoundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-HE-Tag: 1626962706-568302 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 Tue, Jul 20, 2021 at 01:38:53PM -0700, Hugh Dickins wrote: > On Tue, Jul 20, 2021 at 8:57 AM Peter Xu wrote: > > > > In summary, this series should be needed for 5.10/5.12/5.13. This is the 5.10.y > > backport of the series. Patch 1 is a dependency of patch 2, while patch 2 > > should be the real fix. > > > > There's a minor conflict on patch 2 when cherry pick due to not having the new > > helper called page_needs_cow_for_dma(). It's also mentioned at the entry of > > patch 2. > > > > This series should be able to fix a rare race that mentioned in thread: > > > > https://lore.kernel.org/linux-mm/796cbb7-5a1c-1ba0-dde5-479aba8224f2@google.com/ > > > > This fact wasn't discovered when the fix got proposed and merged, because the > > fix was originally about uffd-wp and its fork event. However it turns out that > > the problematic commit b569a1760782f3d is also causing crashing on fork() of > > pmd migration entries which is even more severe than the original uffd-wp > > problem. > > > > Stable kernels at least on 5.12.y has the crash reproduced, and it's possible > > 5.13.y and 5.10.y could hit it due to having the problematic commit > > b569a1760782f3d but lacking of the uffd-wp fix patch (8f34f1eac382, which is > > also patch 2 of this series). > > > > The pmd entry crash problem was reported by Igor Raits and > > debugged by Hugh Dickins . > > > > Please review, thanks. > > And these two for 5.10.y look good to me also: I'm glad you decided in > the end to keep 5.10's support for uffd-wp-fork. > The first is just a straight cherry-pick of > 5fc7a5f6fd04bc18f309d9f979b32ef7d1d0a997, but as you noted above, > 8f34f1eac3820fc2722e5159acceb22545b30b0d needed one line of fixup for > that tree. All now queued up, thanks. greg k-h