[PATCH 02/46] fork: take mmap_lock before copying mm_struct

David Hildenbrand (Arm) david at kernel.org
Wed Oct 28 01:20:12 PDT 2026


On 10/27/26 20:48, Barry Song wrote:
> On Wed, Oct 28, 2026 at 3:07 AM David Hildenbrand (Arm)
> <david at kernel.org> wrote:
>>
>> On 10/27/26 11:38, Pedro Falcato wrote:
>>>
>>> Reviewed-by: Pedro Falcato <pfalcato at suse.de>
>>>
>>> FWIW, strictly speaking malloc() isn't usable in a forked
>>> (multi-threaded) child, but glibc/musl provide this in a best-effort way.
>>
>> Yeah, I'm more concerned about other things that can race ... :)
> 
> Regarding the race with memcpy(mm, oldmm, sizeof(*mm)), we
> still have one [1] even after this patch.
> 
> That is, copying mm_struct can happen concurrently with
> lru_gen_del_mm(). However, this race doesn't seem harmful.
> I might be missing something here though.

Do you have time to look into the issue, to see if it's actually still
reproducible afterwards?

Likely we want a separate fix for that on top. (or mark access as valid racy)

-- 
Cheers,

David



More information about the kexec mailing list