mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 17:23:25 -05:00
s390/signal: remove sigreturn on stack
{rt_}sigreturn is now called from the vdso, so we no longer need the svc on the stack, and therefore no hack to support that mechanism on machines with non-executable stack. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
parent
df29a7440c
commit
fbf50f47ea
4 changed files with 2 additions and 36 deletions
|
@ -14,7 +14,6 @@
|
|||
#define ARCH_EXIT_TO_USER_MODE_WORK (_TIF_GUARDED_STORAGE | _TIF_PER_TRAP)
|
||||
|
||||
void do_per_trap(struct pt_regs *regs);
|
||||
void do_syscall(struct pt_regs *regs);
|
||||
|
||||
#ifdef CONFIG_DEBUG_ENTRY
|
||||
static __always_inline void arch_check_user_regs(struct pt_regs *regs)
|
||||
|
|
|
@ -108,7 +108,7 @@ SYSCALL_DEFINE0(ni_syscall)
|
|||
return -ENOSYS;
|
||||
}
|
||||
|
||||
void do_syscall(struct pt_regs *regs)
|
||||
static void do_syscall(struct pt_regs *regs)
|
||||
{
|
||||
unsigned long nr;
|
||||
|
||||
|
|
|
@ -301,10 +301,9 @@ static void (*pgm_check_table[128])(struct pt_regs *regs);
|
|||
void noinstr __do_pgm_check(struct pt_regs *regs)
|
||||
{
|
||||
unsigned long last_break = S390_lowcore.breaking_event_addr;
|
||||
unsigned int trapnr, syscall_redirect = 0;
|
||||
unsigned int trapnr;
|
||||
irqentry_state_t state;
|
||||
|
||||
add_random_kstack_offset();
|
||||
regs->int_code = *(u32 *)&S390_lowcore.pgm_ilc;
|
||||
regs->int_parm_long = S390_lowcore.trans_exc_code;
|
||||
|
||||
|
@ -346,18 +345,9 @@ void noinstr __do_pgm_check(struct pt_regs *regs)
|
|||
trapnr = regs->int_code & PGM_INT_CODE_MASK;
|
||||
if (trapnr)
|
||||
pgm_check_table[trapnr](regs);
|
||||
syscall_redirect = user_mode(regs) && test_pt_regs_flag(regs, PIF_SYSCALL);
|
||||
out:
|
||||
local_irq_disable();
|
||||
irqentry_exit(regs, state);
|
||||
|
||||
if (syscall_redirect) {
|
||||
enter_from_user_mode(regs);
|
||||
local_irq_enable();
|
||||
regs->orig_gpr2 = regs->gprs[2];
|
||||
do_syscall(regs);
|
||||
exit_to_user_mode();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -285,26 +285,6 @@ static noinline void do_sigbus(struct pt_regs *regs)
|
|||
(void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK));
|
||||
}
|
||||
|
||||
static noinline int signal_return(struct pt_regs *regs)
|
||||
{
|
||||
u16 instruction;
|
||||
int rc;
|
||||
|
||||
rc = __get_user(instruction, (u16 __user *) regs->psw.addr);
|
||||
if (rc)
|
||||
return rc;
|
||||
if (instruction == 0x0a77) {
|
||||
set_pt_regs_flag(regs, PIF_SYSCALL);
|
||||
regs->int_code = 0x00040077;
|
||||
return 0;
|
||||
} else if (instruction == 0x0aad) {
|
||||
set_pt_regs_flag(regs, PIF_SYSCALL);
|
||||
regs->int_code = 0x000400ad;
|
||||
return 0;
|
||||
}
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
static noinline void do_fault_error(struct pt_regs *regs, int access,
|
||||
vm_fault_t fault)
|
||||
{
|
||||
|
@ -312,9 +292,6 @@ static noinline void do_fault_error(struct pt_regs *regs, int access,
|
|||
|
||||
switch (fault) {
|
||||
case VM_FAULT_BADACCESS:
|
||||
if (access == VM_EXEC && signal_return(regs) == 0)
|
||||
break;
|
||||
fallthrough;
|
||||
case VM_FAULT_BADMAP:
|
||||
/* Bad memory access. Check if it is kernel or user space. */
|
||||
if (user_mode(regs)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue