mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
s390/entry: add support for syscall stack randomization
This adds support for adding a random offset to the stack while handling syscalls. The patch uses get_tod_clock_fast() as this is considered good enough and has much less performance penalty compared to using get_random_int(). The patch also adds randomization in pgm_check_handler() as the sigreturn/rt_sigreturn system calls might be called from there. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Link: https://lore.kernel.org/r/20210429091451.1062594-1-svens@linux.ibm.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
committed by
Heiko Carstens
parent
f5b474deca
commit
bae1cd368c
@@ -142,6 +142,7 @@ void do_syscall(struct pt_regs *regs)
|
||||
|
||||
void noinstr __do_syscall(struct pt_regs *regs, int per_trap)
|
||||
{
|
||||
add_random_kstack_offset();
|
||||
enter_from_user_mode(regs);
|
||||
|
||||
memcpy(®s->gprs[8], S390_lowcore.save_area_sync, 8 * sizeof(unsigned long));
|
||||
|
||||
Reference in New Issue
Block a user