[tip: perf/core] uprobes/x86: Allow to copy uprobe trampolines on fork
From: tip-bot2 for Jiri Olsa
Date: Fri Jul 03 2026 - 10:42:08 EST
The following commit has been merged into the perf/core branch of tip:
Commit-ID: d9a48e77f6fe0c11d3cdfcbbcbf4a98ec402e55a
Gitweb: https://git.kernel.org/tip/d9a48e77f6fe0c11d3cdfcbbcbf4a98ec402e55a
Author: Jiri Olsa <jolsa@xxxxxxxxxx>
AuthorDate: Fri, 03 Jul 2026 13:49:08 +02:00
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CommitterDate: Fri, 03 Jul 2026 16:30:35 +02:00
uprobes/x86: Allow to copy uprobe trampolines on fork
When we do fork or clone without CLONE_VM the new process won't
have uprobe trampoline vma objects and at the same time it will
have optimized code calling that trampoline and crash.
Fixing this by allowing vma uprobe trampoline objects to be copied
on fork to the new process.
Fixes: ba2bfc97b462 ("uprobes/x86: Add support to optimize uprobes")
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Reviewed-by: Oleg Nesterov <oleg@xxxxxxxxxx>
Link: https://patch.msgid.link/20260703114917.238144-5-jolsa@xxxxxxxxxx
---
arch/x86/kernel/uprobes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index 7f82056..ba7ca62 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -701,7 +701,7 @@ static struct vm_area_struct *get_uprobe_trampoline(struct mm_struct *mm, unsign
*new_mapping = true;
return _install_special_mapping(mm, vaddr, PAGE_SIZE,
- VM_READ|VM_EXEC|VM_MAYEXEC|VM_MAYREAD|VM_DONTCOPY|VM_IO,
+ VM_READ|VM_EXEC|VM_MAYEXEC|VM_MAYREAD|VM_IO,
&tramp_mapping);
}