[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wiG9xaVvBJXHqTxtop0=mW9KxPS9C54ED23p59VNEKdWg@mail.gmail.com>
Date: Fri, 4 Aug 2023 17:14:38 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Mateusz Guzik <mjguzik@...il.com>
Cc: Suren Baghdasaryan <surenb@...gle.com>, akpm@...ux-foundation.org,
regressions@...mhuis.info, bagasdotme@...il.com,
jacobly.alt@...il.com, willy@...radead.org,
liam.howlett@...cle.com, david@...hat.com, peterx@...hat.com,
ldufour@...ux.ibm.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linuxppc-dev@...ts.ozlabs.org,
linux-arm-kernel@...ts.infradead.org, gregkh@...uxfoundation.org,
regressions@...ts.linux.dev, Jiri Slaby <jirislaby@...nel.org>,
Holger Hoffstätte <holger@...lied-asynchrony.com>,
stable@...r.kernel.org
Subject: Re: [PATCH v2 3/3] fork: lock VMAs of the parent process when forking
On Fri, 4 Aug 2023 at 16:25, Mateusz Guzik <mjguzik@...il.com> wrote:
>
> I know of these guys, I think they are excluded as is -- they go
> through access_remote_vm, starting with:
> if (mmap_read_lock_killable(mm))
> return 0;
>
> while dup_mmap already write locks the parent's mm.
Oh, you're only worried about vma_start_write()?
That's a non-issue. It doesn't take the lock normally, since it starts off with
if (__is_vma_write_locked(vma, &mm_lock_seq))
return;
which catches on the lock sequence number already being set.
So no extra locking there.
Well, technically there's extra locking because the code stupidly
doesn't initialize new vma allocations to the right sequence number,
but that was talked about here:
https://lore.kernel.org/all/CAHk-=wiCrWAoEesBuoGoqqufvesicbGp3cX0LyKgEvsFaZNpDA@mail.gmail.com/
and it's a separate issue.
Linus
Powered by blists - more mailing lists