LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: stable@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Hugh Dickins <hughd@google.com>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	peterx@redhat.com, Hillf Danton <hdanton@sina.com>,
	Igor Raits <igor@gooddata.com>
Subject: [PATCH stable 5.13.y/5.12.y 0/2] mm/thp: Fix uffd-wp with fork(); crash on pmd migration entry on fork
Date: Tue, 20 Jul 2021 11:51:48 -0400	[thread overview]
Message-ID: <20210720155150.497148-1-peterx@redhat.com> (raw)
In-Reply-To: <796cbb7-5a1c-1ba0-dde5-479aba8224f2@google.com>

In summary: this series should be needed for 5.10/5.12/5.13. This is the\r
5.13.y/5.12.y backport of the series, and it should be able to be applied on\r
both of the branches.  Patch 1 is a dependency of patch 2, while patch 2 should\r
be the real fix.\r
\r
This series should be able to fix a rare race that mentioned in thread:\r
\r
https://lore.kernel.org/linux-mm/796cbb7-5a1c-1ba0-dde5-479aba8224f2@google.com/\r
\r
This fact wasn't discovered when the fix got proposed and merged, because the\r
fix was originally about uffd-wp and its fork event.  However it turns out that\r
the problematic commit b569a1760782f3d is also causing crashing on fork() of\r
pmd migration entries which is even more severe than the original uffd-wp\r
problem.\r
\r
Stable kernels at least on 5.12.y has the crash reproduced, and it's possible\r
5.13.y and 5.10.y could hit it due to having the problematic commit\r
b569a1760782f3d but lacking of the uffd-wp fix patch (8f34f1eac382, which is\r
also patch 2 of this series).\r
\r
The pmd entry crash problem was reported by Igor Raits <igor@gooddata.com> and\r
debugged by Hugh Dickins <hughd@google.com>.\r
\r
Please review, thanks.\r
\r
Peter Xu (2):\r
  mm/thp: simplify copying of huge zero page pmd when fork\r
  mm/userfaultfd: fix uffd-wp special cases for fork()\r
\r
 include/linux/huge_mm.h |  2 +-\r
 include/linux/swapops.h |  2 ++\r
 mm/huge_memory.c        | 36 +++++++++++++++++-------------------\r
 mm/memory.c             | 25 +++++++++++++------------\r
 4 files changed, 33 insertions(+), 32 deletions(-)\r
\r
-- \r
2.31.1\r
\r


       reply	other threads:[~2021-07-20 15:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <796cbb7-5a1c-1ba0-dde5-479aba8224f2@google.com>
2021-07-20 15:51 ` Peter Xu [this message]
2021-07-20 15:51   ` [PATCH stable 5.13.y/5.12.y 1/2] mm/thp: simplify copying of huge zero page pmd when fork Peter Xu
2021-07-20 15:51   ` [PATCH stable 5.13.y/5.12.y 2/2] mm/userfaultfd: fix uffd-wp special cases for fork() Peter Xu
2021-07-20 20:32   ` [PATCH stable 5.13.y/5.12.y 0/2] mm/thp: Fix uffd-wp with fork(); crash on pmd migration entry on fork Hugh Dickins
2021-07-22 14:02     ` Greg KH
2021-07-20 15:56 ` [PATCH stable 5.10.y " Peter Xu
2021-07-20 15:56   ` [PATCH stable 5.10.y 1/2] mm/thp: simplify copying of huge zero page pmd when fork Peter Xu
2021-07-20 15:56   ` [PATCH stable 5.10.y 2/2] mm/userfaultfd: fix uffd-wp special cases for fork() Peter Xu
2021-07-20 20:38   ` [PATCH stable 5.10.y 0/2] mm/thp: Fix uffd-wp with fork(); crash on pmd migration entry on fork Hugh Dickins
2021-07-22 14:05     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210720155150.497148-1-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=hdanton@sina.com \
    --cc=hughd@google.com \
    --cc=igor@gooddata.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=stable@vger.kernel.org \
    --subject='Re: [PATCH stable 5.13.y/5.12.y 0/2] mm/thp: Fix uffd-wp with fork(); crash on pmd migration entry on fork' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).