archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <>
To: Mikulas Patocka <>, Peter Xu <>
Cc: Jann Horn <>, Christoph Hellwig <>,
	Oleg Nesterov <>,
	Kirill Shutemov <>, Jan Kara <>,
	Andrea Arcangeli <>,
	Matthew Wilcox <>,
	Andrew Morton <>,
	Linux-MM <>,
	Linux Kernel Mailing List <>,
	linux-nvdimm <>
Subject: Re: a crash when running strace from persistent memory
Date: Thu, 3 Sep 2020 12:55:53 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Thu, Sep 3, 2020 at 12:24 PM Mikulas Patocka <> wrote:
> There's a bug when you run strace from dax-based filesystem.
> -- create real or emulated persistent memory device (/dev/pmem0)
> mkfs.ext2 /dev/pmem0
> -- mount it
> mount -t ext2 -o dax /dev/pmem0 /mnt/test
> -- copy the system to it (well, you can copy just a few files that are
>    needed for running strace and ls)
> cp -ax / /mnt/test
> -- bind the system directories
> mount --bind /dev /mnt/test/dev
> mount --bind /proc /mnt/test/proc
> mount --bind /sys /mnt/test/sys
> -- run strace on the ls command
> chroot /mnt/test/ strace /bin/ls
> You get this warning and ls is killed with SIGSEGV.
> I bisected the problem and it is caused by the commit
> 17839856fd588f4ab6b789f482ed3ffd7c403e1f (gup: document and work around
> "COW can break either way" issue). When I revert the patch (on the kernel
> 5.9-rc3), the bug goes away.

Funky. I really don't see how it could cause that, but we have the
UDDF issue too, so I'm guessing I will have to fix it the radical way
with Peter Xu's series based on my "rip out COW special cases" patch.

Or maybe I'm just using that as an excuse for really wanting to apply
that series.. Because we can't just revert that GUP commit due to
security concerns.

> [   84.191504] WARNING: CPU: 6 PID: 1350 at mm/memory.c:2486 wp_page_copy.cold+0xdb/0xf6

I'm assuming this is the WARN_ON_ONCE(1) on line 2482, and you have
some extra debug patch that causes that line to be off by 4? Because
at least for me, line 2486 is actually an empty line in v5.9-rc3.

That said, I really think this is a pre-existing race, and all the
"COW can break either way" patch does is change the timing (presumably
due to the actual pattern of actually doing the COW changing).

See commit c3e5ea6ee574 ("mm: avoid data corruption on CoW fault into
PFN-mapped VMA") for background.

Mikulas, can you check that everything works ok for that case if you
apply Peter's series? See

or if you have 'b4' installed, use

    b4 am

to get the series..

Linux-nvdimm mailing list --
To unsubscribe send an email to

  reply	other threads:[~2020-09-03 19:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 19:24 a crash when running strace from persistent memory Mikulas Patocka
2020-09-03 19:55 ` Linus Torvalds [this message]
2020-09-04  8:08   ` Mikulas Patocka
2020-09-04 17:11     ` Linus Torvalds
2020-09-04 16:21 ` make misbehavior on ext2 in dax mode (was: a crash when running strace from persistent memory) Mikulas Patocka
2020-09-05 12:11   ` Mikulas Patocka
2020-09-05 12:12     ` [PATCH 1/2] ext2: don't update mtime on COW faults Mikulas Patocka
2020-09-07  9:00       ` Jan Kara
2020-09-05 12:13     ` [PATCH 2/2] xfs: " Mikulas Patocka
2020-09-05 15:36       ` Darrick J. Wong
2020-09-05 17:02         ` Mikulas Patocka
2020-09-10  6:06           ` Darrick J. Wong
2020-09-11 16:41             ` Mikulas Patocka
2020-09-05 16:47       ` Linus Torvalds
2020-09-05 17:03         ` Linus Torvalds
2020-09-07  8:59           ` Jan Kara
2020-09-05 17:04         ` [PATCH 2/2 v2] " Mikulas Patocka
2020-09-07  6:47       ` [PATCH 2/2] " Christoph Hellwig

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:

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

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* 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).