]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/shstk: Make return uprobe work with shadow stack
authorJiri Olsa <jolsa@kernel.org>
Tue, 11 Jun 2024 23:44:27 +0000 (08:44 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 11 Jun 2024 23:44:27 +0000 (08:44 +0900)
commit1713b63a07a28a475de94664f783b4cfd2e4fa90
tree7abbd076ad664d9ac4299b4a07e1b6a3276b1fd1
parent1b3c86eeea7594eeeb49b8d1c1db0a40f0ce7920
x86/shstk: Make return uprobe work with shadow stack

Currently the application with enabled shadow stack will crash
if it sets up return uprobe. The reason is the uretprobe kernel
code changes the user space task's stack, but does not update
shadow stack accordingly.

Adding new functions to update values on shadow stack and using
them in uprobe code to keep shadow stack in sync with uretprobe
changes to user stack.

Link: https://lore.kernel.org/all/20240611112158.40795-2-jolsa@kernel.org/
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Fixes: 488af8ea7131 ("x86/shstk: Wire in shadow stack interface")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
arch/x86/include/asm/shstk.h
arch/x86/kernel/shstk.c
arch/x86/kernel/uprobes.c