linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Peter Xu <peterx@redhat.com>
Cc: Hugh Dickins <hughd@google.com>, Igor Raits <igor@gooddata.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Hillf Danton <hdanton@sina.com>,
	 Axel Rasmussen <axelrasmussen@google.com>,
	linux-mm@kvack.org
Subject: Re: kernel BUG at include/linux/swapops.h:204!
Date: Mon, 19 Jul 2021 15:42:41 -0700 (PDT)	[thread overview]
Message-ID: <757b684a-67b5-999b-7f2d-b55fb1c61fd8@google.com> (raw)
In-Reply-To: <YPX46x/pet5Sn5gC@t490s>

On Mon, 19 Jul 2021, Peter Xu wrote:
> On Mon, Jul 19, 2021 at 12:11:21PM -0700, Hugh Dickins wrote:
> > 
> > But I'm confident that 8f34f1eac382 will prove to be the fix, so Peter
> > please prepare some backports of that for the various stable/longterm
> > kernels that need it - I've not looked into whether it applies cleanly,
> > or depends on other commits too.  You fixed several related but different
> > things in that commit: but this one is the worst, because it can corrupt
> > even those who are not using UFFD_WP at all.
> 
> Looks right to me, b569a1760782 ("userfaultfd: wp: drop _PAGE_UFFD_WP properly
> when fork", 2020-04-07) seems to be the culprit.  I didn't notice the side
> effect in the bug or in the fix, or it should have already land stables. I am
> very sorry for such a preliminary bug that caused this fallout - I really can't
> tell why I completely didn't look at is_swap_pte() that's so obvious indeed.
> 
> I checked it up, 5.6.y doesn't have the issue commit yet as it's not marked as
> "fixes". It started to show up in 5.7.y~5.13.y. 5.14-rc1 has 8f34f1eac382 which
> is the fix.  So I think we need the fix or equivalent fix for 5.7.y~5.13.y.
> 
> 5.12.y & 5.13.y can pick up the fix 8f34f1eac382 cleanly.  For the olders
> (5.7.y~5.11.y) they can't.  I plan to revert b569a1760782 instead.
> 
...
> 
> Please let me know if there's any comment on the backport plan above, or I'll
> prepare the patches for all the branches before tomorrow.

Thanks for getting on to it so quickly, Peter.

The only non-EOL stable/longterm releases are then 5.13, 5.12 and 5.10.

I have no appreciation of the importance of UFFD_EVENT_FORK support
for uffd-wp.  And no appreciation of the importance of the other bugs
you fixed in 8f34f1eac382, and other uffd-wp fixes you may have made
recently, some backported, some not.

But I think it is worth giving 5.10, the longterm, a little more
consideration: don't be driven by whether 8f34f1eac382 applies cleanly
(all 5.13 and 5.12 would require then is a mail to GregKH Cc stable
asking him to add that commit), but by how important the support is
to users of 5.10, and how far away from working safely it is - maybe
a 5.10-specific patch would be worthwhile, maybe not, I cannot judge.

Hugh


  reply	other threads:[~2021-07-19 22:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-10  7:33 kernel BUG at include/linux/swapops.h:204! Igor Raits
2021-07-10 12:46 ` Hillf Danton
2021-07-11  4:17 ` Hugh Dickins
2021-07-11  6:06   ` Igor Raits
2021-07-15 17:47     ` Igor Raits
2021-07-16 19:45       ` Hugh Dickins
2021-07-19 19:11         ` Hugh Dickins
2021-07-19 22:12           ` Peter Xu
2021-07-19 22:42             ` Hugh Dickins [this message]
2021-07-20  0:34               ` Peter Xu
2021-07-20  3:31                 ` Hugh Dickins
2021-07-20  7:47             ` Igor Raits
2021-07-20 16:01               ` Peter Xu
2021-07-20 16:05                 ` Igor Raits
2021-07-20 15:51           ` [PATCH stable 5.13.y/5.12.y 0/2] mm/thp: Fix uffd-wp with fork(); crash on pmd migration entry on fork Peter Xu
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=757b684a-67b5-999b-7f2d-b55fb1c61fd8@google.com \
    --to=hughd@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=hdanton@sina.com \
    --cc=igor@gooddata.com \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).