This is a note to let you know that I've just added the patch titled s390/vdso64: add sigreturn,rt_sigreturn and restart_syscall to the 5.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: s390-vdso64-add-sigreturn-rt_sigreturn-and-restart_syscall.patch and it can be found in the queue-5.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 686341f2548b5a4c4ab1ee22427e046027ae1c9c Mon Sep 17 00:00:00 2001 From: Sven Schnelle <svens@xxxxxxxxxxxxx> Date: Fri, 25 Jun 2021 14:48:28 +0200 Subject: s390/vdso64: add sigreturn,rt_sigreturn and restart_syscall From: Sven Schnelle <svens@xxxxxxxxxxxxx> commit 686341f2548b5a4c4ab1ee22427e046027ae1c9c upstream. Add minimalistic trampolines to vdso64 so we can return from signal without using the stack which requires pgm check handler hacks when NX is enabled. restart_syscall will be called from vdso to work around the architectural limitation that the syscall number might be encoded in the svc instruction, and therefore can not be changed. Signed-off-by: Sven Schnelle <svens@xxxxxxxxxxxxx> Reviewed-by: Heiko Carstens <hca@xxxxxxxxxxxxx> Signed-off-by: Vasily Gorbik <gor@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/s390/kernel/vdso64/vdso64.lds.S | 3 +++ arch/s390/kernel/vdso64/vdso_user_wrapper.S | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) --- a/arch/s390/kernel/vdso64/vdso64.lds.S +++ b/arch/s390/kernel/vdso64/vdso64.lds.S @@ -137,6 +137,9 @@ VERSION __kernel_clock_gettime; __kernel_clock_getres; __kernel_getcpu; + __kernel_restart_syscall; + __kernel_rt_sigreturn; + __kernel_sigreturn; local: *; }; } --- a/arch/s390/kernel/vdso64/vdso_user_wrapper.S +++ b/arch/s390/kernel/vdso64/vdso_user_wrapper.S @@ -37,3 +37,20 @@ vdso_func gettimeofday vdso_func clock_getres vdso_func clock_gettime vdso_func getcpu + +.macro vdso_syscall func,syscall + .globl __kernel_\func + .type __kernel_\func,@function + .align 8 +__kernel_\func: + CFI_STARTPROC + svc \syscall + /* Make sure we notice when a syscall returns, which shouldn't happen */ + .word 0 + CFI_ENDPROC + .size __kernel_\func,.-__kernel_\func +.endm + +vdso_syscall restart_syscall,__NR_restart_syscall +vdso_syscall sigreturn,__NR_sigreturn +vdso_syscall rt_sigreturn,__NR_rt_sigreturn Patches currently in stable-queue which might be from svens@xxxxxxxxxxxxx are queue-5.12/s390-vdso-rename-vdso64_lbase-to-vdso_lbase.patch queue-5.12/s390-vdso64-add-sigreturn-rt_sigreturn-and-restart_syscall.patch queue-5.12/s390-signal-switch-to-using-vdso-for-sigreturn-and-syscall-restart.patch queue-5.12/s390-vdso-add-minimal-compat-vdso.patch queue-5.12/s390-vdso-always-enable-vdso.patch