]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
uprobes/x86: Harden uretprobe syscall trampoline check
authorJiri Olsa <jolsa@kernel.org>
Wed, 12 Feb 2025 22:04:33 +0000 (23:04 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 6 Mar 2025 11:22:45 +0000 (12:22 +0100)
commitfa6192adc32f4fdfe5b74edd5b210e12afd6ecc0
tree5f729a51506852be9e066fbce1414b2e653aaad7
parent05763885e327f0e257ee8b96b30ac1b95f7dd532
uprobes/x86: Harden uretprobe syscall trampoline check

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
arch/x86/kernel/uprobes.c
include/linux/uprobes.h
kernel/events/uprobes.c