Thread (12 messages) 12 messages, 3 authors, 2024-09-11

Re: [PATCH] uprobes: use vm_special_mapping close() functionality

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2024-09-03 19:12:55
Also in: linux-perf-users, lkml

Possibly related (same subject, not in this thread)

On Tue, 3 Sept 2024 at 02:09, Oleg Nesterov [off-list ref] 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:

-       area->xol_mapping.name = "[uprobes]";
-       area->xol_mapping.fault = NULL;
-       area->xol_mapping.pages = area->pages;
+       area->xol_mapping = (struct vm_special_mapping) {
+               .name = "[uprobes]",
+               .pages = area->pages,
+               .close = uprobe_clear_state,
+       };

which should initialize the struct vm_special_mapping fully.

                     Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help