Thread (22 messages) 22 messages, 3 authors, 2023-08-10

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

From: Mateusz Guzik <hidden>
Date: 2023-08-04 23:25:55
Also in: linux-mm, linuxppc-dev, lkml, regressions, stable

On 8/5/23, Linus Torvalds [off-list ref] wrote:
On Fri, 4 Aug 2023 at 14:46, Mateusz Guzik [off-list ref] wrote:
quoted
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.
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.

I don't see any surprise relocks of the semaphore.

Granted, should someone *bypass* this mechanism the above would be moot.

-- 
Mateusz Guzik <mjguzik gmail.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help