summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2025-02-13 01:04:33 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-10 15:39:37 +0300
commitc35771342e47d58ab9433f3be1c3c30f2c5fa4f3 (patch)
tree0fc8281db806d6de3259924786821bce64451c30 /include
parent3a8bec6583e5239de3bd597ab382dc6c2b0c29a1 (diff)
downloadlinux-c35771342e47d58ab9433f3be1c3c30f2c5fa4f3.tar.xz
uprobes/x86: Harden uretprobe syscall trampoline check
commit fa6192adc32f4fdfe5b74edd5b210e12afd6ecc0 upstream. Jann reported a possible issue when trampoline_check_ip returns address near the bottom of the address space that is allowed to call into the syscall if uretprobes are not set up: https://lore.kernel.org/bpf/202502081235.5A6F352985@keescook/T/#m9d416df341b8fbc11737dacbcd29f0054413cbbf Though the mmap minimum address restrictions will typically prevent creating mappings there, let's make sure uretprobe syscall checks for that. Fixes: ff474a78cef5 ("uprobe: Add uretprobe syscall to speed up return probe") Reported-by: Jann Horn <jannh@google.com> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Kees Cook <kees@kernel.org> Acked-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Acked-by: Alexei Starovoitov <alexei.starovoitov@gmail.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250212220433.3624297-1-jolsa@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/uprobes.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index 2b294bf1881f..d0cb0e02cd6a 100644
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -28,6 +28,8 @@ struct page;
#define MAX_URETPROBE_DEPTH 64
+#define UPROBE_NO_TRAMPOLINE_VADDR (~0UL)
+
struct uprobe_consumer {
/*
* handler() can return UPROBE_HANDLER_REMOVE to signal the need to