[PATCH v2 3/3] fork: lock VMAs of the parent process when forking

Linus Torvalds torvalds at linux-foundation.org
Fri Aug 4 15:49:40 PDT 2023


On Fri, 4 Aug 2023 at 14:46, Mateusz Guzik <mjguzik at gmail.com> wrote:
>
> I don't see it mentioned in the discussion, so at a risk of ruffling
> feathers or looking really bad I'm going to ask: is the locking of any
> use if the forking process is single-threaded? T

Sadly, we've always been able to access the mm from other processes,
so the locking is - I think - unavoidable.

And some of those "access from other processes" aren't even uncommon
or special. It's things like "ps" etc, that do it just to see the
process name and arguments.

            Linus



More information about the linux-arm-kernel mailing list