lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjdCtgtQPZPTigMMniZaoMA_tHDu3EMBVM3w1GH5X+cOw@mail.gmail.com>
Date:   Thu, 21 Apr 2022 12:28:20 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Andrei Vagin <avagin@...il.com>
Cc:     kernel test robot <oliver.sang@...el.com>,
        Dmitry Safonov <0x7f454c46@...il.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Andrew Morton <akpm@...ux-foundation.org>,
        LKML <linux-kernel@...r.kernel.org>, lkp@...ts.01.org,
        kernel test robot <lkp@...el.com>,
        Mike Rapoport <rppt@...ux.ibm.com>
Subject: Re: [fs/pipe] 5a519c8fe4: WARNING:at_mm/page_alloc.c:#__alloc_pages

On Thu, Apr 21, 2022 at 9:30 AM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> The pipe part sounds like a horrible hacky thing.
>
> I also assume you already tried that, and hit some performance issues.
> But it does sound like the better interface, more directly what you
> want.
>
> So what are the problems with using process_vm_readv?

Actually, I take that back.

Don't use pipes.

Don't use process_vm_readv().

Use the system call we already have for "snapshot the current VM".

It's called "fork()". It's cheap, it's efficient, and it snapshots the
whole VM in one go. No stupid extra buffers in pipes, no crazy things
like that.

So just make your pre-dump code do a simple fork(), let the parent
continue, and then do the dumping in the child at whatever pace you
want.

In fact, you might just leave the child process alone, and let it _be_
that pre-dump.

You can create a new snapshot every once in a while, and kill the
previous snapshot, if you want to keep the snapshot close to the
target, and then use the memory tracking to track what has changed
since.

And you might not want to use plain "fork()", but instead some kind of
"clone()" variant. You might want to use CLONE_PARENT and some
non-SIGCHLD exit signal to basically hide the snapshot image from the
thing you are snapshotting.

Anyway, the "use vmsplice to a pipe to create a snapshot" sounds just
insane when you have a very traditional system call that is all about
snapshotting the process.

Maybe a new CLONE_xyz flag could be added to make that memory tracking
integrate better or whatever.

Any showstoppers?

                         Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ