Re: [PATCH] uprobes: use vm_special_mapping close() functionality
From: Sven Schnelle
Date: Tue Sep 03 2024 - 15:31:53 EST
Hi Linus,
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:
> On Tue, 3 Sept 2024 at 02:09, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>>
>> but with or without this fix __create_xol_area() also needs
>>
>> area->xol_mapping.mremap = NULL;
>
> I think the whole thing needs to be zeroed out.
>
> It was always horribly buggy. The close thing just made it more
> *obviously* buggy, because closing a vma is a lot more common than
> mremap'ing it.
>
> Either use kzalloc(), or do a proper initializer something like this:
I sent a patch which does this today:
https://lore.kernel.org/all/20240903102313.3402529-1-svens@xxxxxxxxxxxxx/