Commit 54d46ea9 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal

Pull signal handling cleanups from Al Viro:
 "sigaltstack infrastructure + conversion for x86, alpha and um,
  COMPAT_SYSCALL_DEFINE infrastructure.

  Note that there are several conflicts between "unify
  SS_ONSTACK/SS_DISABLE definitions" and UAPI patches in mainline;
  resolution is trivial - just remove definitions of SS_ONSTACK and
  SS_DISABLED from arch/*/uapi/asm/signal.h; they are all identical and
  include/uapi/linux/signal.h contains the unified variant."

Fixed up conflicts as per Al.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
  alpha: switch to generic sigaltstack
  new helpers: __save_altstack/__compat_save_altstack, switch x86 and um to those
  generic compat_sys_sigaltstack()
  introduce generic sys_sigaltstack(), switch x86 and um to it
  new helper: compat_user_stack_pointer()
  new helper: restore_altstack()
  unify SS_ONSTACK/SS_DISABLE definitions
  new helper: current_user_stack_pointer()
  missing user_stack_pointer() instances
  Bury the conditionals from kernel_thread/kernel_execve series
  COMPAT_SYSCALL_DEFINE: infrastructure
parents f59dc2bb 50ececcf
...@@ -291,12 +291,6 @@ config ARCH_WANT_OLD_COMPAT_IPC ...@@ -291,12 +291,6 @@ config ARCH_WANT_OLD_COMPAT_IPC
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
bool bool
config GENERIC_KERNEL_THREAD
bool
config GENERIC_KERNEL_EXECVE
bool
config HAVE_ARCH_SECCOMP_FILTER config HAVE_ARCH_SECCOMP_FILTER
bool bool
help help
...@@ -362,6 +356,9 @@ config MODULES_USE_ELF_REL ...@@ -362,6 +356,9 @@ config MODULES_USE_ELF_REL
Modules only use ELF REL relocations. Modules with ELF RELA Modules only use ELF REL relocations. Modules with ELF RELA
relocations will give an error. relocations will give an error.
config GENERIC_SIGALTSTACK
bool
# #
# ABI hall of shame # ABI hall of shame
# #
......
...@@ -20,10 +20,9 @@ config ALPHA ...@@ -20,10 +20,9 @@ config ALPHA
select GENERIC_CMOS_UPDATE select GENERIC_CMOS_UPDATE
select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER select GENERIC_STRNLEN_USER
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_SIGALTSTACK
help help
The Alpha is a 64-bit general-purpose processor designed and The Alpha is a 64-bit general-purpose processor designed and
marketed by the Digital Equipment Corporation of blessed memory, marketed by the Digital Equipment Corporation of blessed memory,
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#define user_mode(regs) (((regs)->ps & 8) != 0) #define user_mode(regs) (((regs)->ps & 8) != 0)
#define instruction_pointer(regs) ((regs)->pc) #define instruction_pointer(regs) ((regs)->pc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define current_user_stack_pointer() rdusp()
#define task_pt_regs(task) \ #define task_pt_regs(task) \
((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1) ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#define __ARCH_WANT_SYS_OLDUMOUNT #define __ARCH_WANT_SYS_OLDUMOUNT
#define __ARCH_WANT_SYS_SIGPENDING #define __ARCH_WANT_SYS_SIGPENDING
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -84,12 +84,6 @@ typedef unsigned long sigset_t; ...@@ -84,12 +84,6 @@ typedef unsigned long sigset_t;
#define SA_ONESHOT SA_RESETHAND #define SA_ONESHOT SA_RESETHAND
#define SA_NOMASK SA_NODEFER #define SA_NOMASK SA_NODEFER
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 4096 #define MINSIGSTKSZ 4096
#define SIGSTKSZ 16384 #define SIGSTKSZ 16384
......
...@@ -122,12 +122,6 @@ SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask) ...@@ -122,12 +122,6 @@ SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
return sigsuspend(&blocked); return sigsuspend(&blocked);
} }
asmlinkage int
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
{
return do_sigaltstack(uss, uoss, rdusp());
}
/* /*
* Do a signal return; undo the signal stack. * Do a signal return; undo the signal stack.
*/ */
...@@ -418,9 +412,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -418,9 +412,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
err |= __put_user(0, &frame->uc.uc_flags); err |= __put_user(0, &frame->uc.uc_flags);
err |= __put_user(0, &frame->uc.uc_link); err |= __put_user(0, &frame->uc.uc_link);
err |= __put_user(set->sig[0], &frame->uc.uc_osf_sigmask); err |= __put_user(set->sig[0], &frame->uc.uc_osf_sigmask);
err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); err |= __save_altstack(&frame->uc.uc_stack, oldsp);
err |= __put_user(sas_ss_flags(oldsp), &frame->uc.uc_stack.ss_flags);
err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, err |= setup_sigcontext(&frame->uc.uc_mcontext, regs,
set->sig[0], oldsp); set->sig[0], oldsp);
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
......
...@@ -12,8 +12,6 @@ config ARM ...@@ -12,8 +12,6 @@ config ARM
select GENERIC_CLOCKEVENTS_BROADCAST if SMP select GENERIC_CLOCKEVENTS_BROADCAST if SMP
select GENERIC_IRQ_PROBE select GENERIC_IRQ_PROBE
select GENERIC_IRQ_SHOW select GENERIC_IRQ_SHOW
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select GENERIC_PCI_IOMAP select GENERIC_PCI_IOMAP
select GENERIC_SMP_IDLE_THREAD select GENERIC_SMP_IDLE_THREAD
select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNCPY_FROM_USER
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_SYS_SOCKETCALL #define __ARCH_WANT_SYS_SOCKETCALL
#endif #endif
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -87,13 +87,6 @@ typedef unsigned long sigset_t; ...@@ -87,13 +87,6 @@ typedef unsigned long sigset_t;
#define SA_NOMASK SA_NODEFER #define SA_NOMASK SA_NODEFER
#define SA_ONESHOT SA_RESETHAND #define SA_ONESHOT SA_RESETHAND
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -8,8 +8,6 @@ config ARM64 ...@@ -8,8 +8,6 @@ config ARM64
select GENERIC_IOMAP select GENERIC_IOMAP
select GENERIC_IRQ_PROBE select GENERIC_IRQ_PROBE
select GENERIC_IRQ_SHOW select GENERIC_IRQ_SHOW
select GENERIC_KERNEL_EXECVE
select GENERIC_KERNEL_THREAD
select GENERIC_SMP_IDLE_THREAD select GENERIC_SMP_IDLE_THREAD
select GENERIC_TIME_VSYSCALL select GENERIC_TIME_VSYSCALL
select HARDIRQS_SW_RESEND select HARDIRQS_SW_RESEND
......
...@@ -209,10 +209,11 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) ...@@ -209,10 +209,11 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
return (u32)(unsigned long)uptr; return (u32)(unsigned long)uptr;
} }
#define compat_user_stack_pointer() (current_pt_regs()->compat_sp)
static inline void __user *arch_compat_alloc_user_space(long len) static inline void __user *arch_compat_alloc_user_space(long len)
{ {
struct pt_regs *regs = task_pt_regs(current); return (void __user *)compat_user_stack_pointer() - len;
return (void __user *)regs->compat_sp - len;
} }
struct compat_ipc64_perm { struct compat_ipc64_perm {
......
...@@ -28,6 +28,5 @@ ...@@ -28,6 +28,5 @@
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#endif #endif
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
...@@ -17,8 +17,6 @@ config AVR32 ...@@ -17,8 +17,6 @@ config AVR32
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
help help
AVR32 is a high-performance 32-bit RISC microprocessor core, AVR32 is a high-performance 32-bit RISC microprocessor core,
designed for cost-sensitive embedded applications, with particular designed for cost-sensitive embedded applications, with particular
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER) #define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER)
#define instruction_pointer(regs) ((regs)->pc) #define instruction_pointer(regs) ((regs)->pc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(regs) ((regs)->sp)
static __inline__ int valid_user_regs(struct pt_regs *regs) static __inline__ int valid_user_regs(struct pt_regs *regs)
{ {
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#define __ARCH_WANT_SYS_GETPGRP #define __ARCH_WANT_SYS_GETPGRP
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -89,12 +89,6 @@ typedef unsigned long sigset_t; ...@@ -89,12 +89,6 @@ typedef unsigned long sigset_t;
#define SA_NOMASK SA_NODEFER #define SA_NOMASK SA_NODEFER
#define SA_ONESHOT SA_RESETHAND #define SA_ONESHOT SA_RESETHAND
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -45,8 +45,6 @@ config BLACKFIN ...@@ -45,8 +45,6 @@ config BLACKFIN
select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
config GENERIC_CSUM config GENERIC_CSUM
def_bool y def_bool y
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#define arch_has_single_step() (1) #define arch_has_single_step() (1)
/* common code demands this function */ /* common code demands this function */
#define ptrace_disable(child) user_disable_single_step(child) #define ptrace_disable(child) user_disable_single_step(child)
#define current_user_stack_pointer() rdusp()
extern int is_user_addr_valid(struct task_struct *child, extern int is_user_addr_valid(struct task_struct *child,
unsigned long start, unsigned long len); unsigned long start, unsigned long len);
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#define __ARCH_WANT_SYS_NICE #define __ARCH_WANT_SYS_NICE
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
/* /*
......
...@@ -17,8 +17,6 @@ config C6X ...@@ -17,8 +17,6 @@ config C6X
select OF select OF
select OF_EARLY_FLATTREE select OF_EARLY_FLATTREE
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
config MMU config MMU
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
* more details. * more details.
*/ */
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
/* Use the standard ABI for syscalls. */ /* Use the standard ABI for syscalls. */
......
...@@ -49,8 +49,6 @@ config CRIS ...@@ -49,8 +49,6 @@ config CRIS
select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32 select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32
select GENERIC_CMOS_UPDATE select GENERIC_CMOS_UPDATE
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select CLONE_BACKWARDS2 select CLONE_BACKWARDS2
config HZ config HZ
......
...@@ -9,5 +9,6 @@ ...@@ -9,5 +9,6 @@
#define PTRACE_SETREGS 13 #define PTRACE_SETREGS 13
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define current_user_stack_pointer() rdusp()
#endif /* _CRIS_PTRACE_H */ #endif /* _CRIS_PTRACE_H */
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -83,12 +83,6 @@ typedef unsigned long sigset_t; ...@@ -83,12 +83,6 @@ typedef unsigned long sigset_t;
#define SA_RESTORER 0x04000000 #define SA_RESTORER 0x04000000
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -12,8 +12,6 @@ config FRV ...@@ -12,8 +12,6 @@ config FRV
select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_HAVE_NMI_SAFE_CMPXCHG
select GENERIC_CPU_DEVICES select GENERIC_CPU_DEVICES
select ARCH_WANT_IPC_PARSE_VERSION select ARCH_WANT_IPC_PARSE_VERSION
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
config ZONE_DMA config ZONE_DMA
bool bool
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -9,8 +9,6 @@ config H8300 ...@@ -9,8 +9,6 @@ config H8300
select GENERIC_IRQ_SHOW select GENERIC_IRQ_SHOW
select GENERIC_CPU_DEVICES select GENERIC_CPU_DEVICES
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
config SYMBOL_PREFIX config SYMBOL_PREFIX
string string
......
...@@ -28,5 +28,6 @@ ...@@ -28,5 +28,6 @@
#define current_pt_regs() ((struct pt_regs *) \ #define current_pt_regs() ((struct pt_regs *) \
(THREAD_SIZE + (unsigned long)current_thread_info()) - 1) (THREAD_SIZE + (unsigned long)current_thread_info()) - 1)
#define signal_pt_regs() ((struct pt_regs *)current->thread.esp0) #define signal_pt_regs() ((struct pt_regs *)current->thread.esp0)
#define current_user_stack_pointer() rdusp()
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* _H8300_PTRACE_H */ #endif /* _H8300_PTRACE_H */
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -82,12 +82,6 @@ typedef unsigned long sigset_t; ...@@ -82,12 +82,6 @@ typedef unsigned long sigset_t;
#define SA_RESTORER 0x04000000 #define SA_RESTORER 0x04000000
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -31,8 +31,6 @@ config HEXAGON ...@@ -31,8 +31,6 @@ config HEXAGON
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select GENERIC_CLOCKEVENTS_BROADCAST select GENERIC_CLOCKEVENTS_BROADCAST
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
---help--- ---help---
Qualcomm Hexagon is a processor architecture designed for high Qualcomm Hexagon is a processor architecture designed for high
performance and low power across a wide variety of applications. performance and low power across a wide variety of applications.
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
*/ */
#define sys_mmap2 sys_mmap_pgoff #define sys_mmap2 sys_mmap_pgoff
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
#include <asm-generic/unistd.h> #include <asm-generic/unistd.h>
...@@ -42,8 +42,6 @@ config IA64 ...@@ -42,8 +42,6 @@ config IA64
select GENERIC_TIME_VSYSCALL_OLD select GENERIC_TIME_VSYSCALL_OLD
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
default y default y
help help
The Itanium Processor Family is Intel's 64-bit successor to The Itanium Processor Family is Intel's 64-bit successor to
......
...@@ -78,6 +78,11 @@ static inline long regs_return_value(struct pt_regs *regs) ...@@ -78,6 +78,11 @@ static inline long regs_return_value(struct pt_regs *regs)
unsigned long __ip = instruction_pointer(regs); \ unsigned long __ip = instruction_pointer(regs); \
(__ip & ~3UL) + ((__ip & 3UL) << 2); \ (__ip & ~3UL) + ((__ip & 3UL) << 2); \
}) })
/*
* Why not default? Because user_stack_pointer() on ia64 gives register
* stack backing store instead...
*/
#define current_user_stack_pointer() (current_pt_regs()->r12)
/* given a pointer to a task_struct, return the user's pt_regs */ /* given a pointer to a task_struct, return the user's pt_regs */
# define task_pt_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1) # define task_pt_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1)
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER) #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
......
...@@ -78,12 +78,6 @@ ...@@ -78,12 +78,6 @@
#define SA_RESTORER 0x04000000 #define SA_RESTORER 0x04000000
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
/* /*
* The minimum stack size needs to be fairly large because we want to * The minimum stack size needs to be fairly large because we want to
* be sure that an app compiled for today's CPUs will continue to run * be sure that an app compiled for today's CPUs will continue to run
......
...@@ -15,8 +15,6 @@ config M32R ...@@ -15,8 +15,6 @@ config M32R
select GENERIC_ATOMIC64 select GENERIC_ATOMIC64
select ARCH_USES_GETTIMEOFFSET select ARCH_USES_GETTIMEOFFSET
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
config SBUS config SBUS
bool bool
......
...@@ -32,6 +32,7 @@ extern void init_debug_traps(struct task_struct *); ...@@ -32,6 +32,7 @@ extern void init_debug_traps(struct task_struct *);
#define instruction_pointer(regs) ((regs)->bpc) #define instruction_pointer(regs) ((regs)->bpc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(regs) ((regs)->spu)
extern void withdraw_debug_trap(struct pt_regs *regs); extern void withdraw_debug_trap(struct pt_regs *regs);
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#define __ARCH_WANT_SYS_OLDUMOUNT #define __ARCH_WANT_SYS_OLDUMOUNT
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
......
...@@ -84,12 +84,6 @@ typedef unsigned long sigset_t; ...@@ -84,12 +84,6 @@ typedef unsigned long sigset_t;
#define SA_RESTORER 0x04000000 #define SA_RESTORER 0x04000000
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -15,8 +15,6 @@ config M68K ...@@ -15,8 +15,6 @@ config M68K
select FPU if MMU select FPU if MMU
select ARCH_WANT_IPC_PARSE_VERSION select ARCH_WANT_IPC_PARSE_VERSION
select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_REL select MODULES_USE_ELF_REL
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define current_pt_regs() \ #define current_pt_regs() \
(struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1 (struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1
#define current_user_stack_pointer() rdusp()
#define arch_has_single_step() (1) #define arch_has_single_step() (1)
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
......
...@@ -80,12 +80,6 @@ typedef unsigned long sigset_t; ...@@ -80,12 +80,6 @@ typedef unsigned long sigset_t;
#define SA_NOMASK SA_NODEFER #define SA_NOMASK SA_NODEFER
#define SA_ONESHOT SA_RESETHAND #define SA_ONESHOT SA_RESETHAND
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -26,8 +26,6 @@ config MICROBLAZE ...@@ -26,8 +26,6 @@ config MICROBLAZE
select GENERIC_ATOMIC64 select GENERIC_ATOMIC64
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select CLONE_BACKWARDS select CLONE_BACKWARDS
config SWAP config SWAP
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define instruction_pointer(regs) ((regs)->pc) #define instruction_pointer(regs) ((regs)->pc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(regs) ((regs)->r1)
static inline long regs_return_value(struct pt_regs *regs) static inline long regs_return_value(struct pt_regs *regs)
{ {
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
......
...@@ -41,8 +41,6 @@ config MIPS ...@@ -41,8 +41,6 @@ config MIPS
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_REL select MODULES_USE_ELF_REL
select MODULES_USE_ELF_RELA if 64BIT select MODULES_USE_ELF_RELA if 64BIT
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
menu "Machine selection" menu "Machine selection"
......
...@@ -49,6 +49,7 @@ static inline long regs_return_value(struct pt_regs *regs) ...@@ -49,6 +49,7 @@ static inline long regs_return_value(struct pt_regs *regs)
#define instruction_pointer(regs) ((regs)->cp0_epc) #define instruction_pointer(regs) ((regs)->cp0_epc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(r) ((r)->regs[29])
extern asmlinkage void syscall_trace_enter(struct pt_regs *regs); extern asmlinkage void syscall_trace_enter(struct pt_regs *regs);
extern asmlinkage void syscall_trace_leave(struct pt_regs *regs); extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#define __ARCH_OMIT_COMPAT_SYS_GETDENTS64 #define __ARCH_OMIT_COMPAT_SYS_GETDENTS64
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_ALARM
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_GETHOSTNAME
#define __ARCH_WANT_SYS_IPC #define __ARCH_WANT_SYS_IPC
#define __ARCH_WANT_SYS_PAUSE #define __ARCH_WANT_SYS_PAUSE
......
...@@ -86,12 +86,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ ...@@ -86,12 +86,6 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
#define SA_RESTORER 0x04000000 /* Only for o32 */ #define SA_RESTORER 0x04000000 /* Only for o32 */
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -8,8 +8,6 @@ config MN10300 ...@@ -8,8 +8,6 @@ config MN10300
select HAVE_ARCH_KGDB select HAVE_ARCH_KGDB
select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
config AM33_2 config AM33_2
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -92,12 +92,6 @@ typedef unsigned long sigset_t; ...@@ -92,12 +92,6 @@ typedef unsigned long sigset_t;
#define SA_RESTORER 0x04000000 #define SA_RESTORER 0x04000000
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -22,8 +22,6 @@ config OPENRISC ...@@ -22,8 +22,6 @@ config OPENRISC
select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER select GENERIC_STRNLEN_USER
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
config MMU config MMU
def_bool y def_bool y
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#define sys_mmap2 sys_mmap_pgoff #define sys_mmap2 sys_mmap_pgoff
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -22,8 +22,6 @@ config PARISC ...@@ -22,8 +22,6 @@ config PARISC
select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNCPY_FROM_USER
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select CLONE_BACKWARDS select CLONE_BACKWARDS
help help
......
...@@ -163,7 +163,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ ...@@ -163,7 +163,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -71,12 +71,6 @@ ...@@ -71,12 +71,6 @@
#define SA_RESTORER 0x04000000 /* obsolete -- ignored */ #define SA_RESTORER 0x04000000 /* obsolete -- ignored */
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -141,10 +141,8 @@ config PPC ...@@ -141,10 +141,8 @@ config PPC
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER select GENERIC_STRNLEN_USER
select GENERIC_KERNEL_THREAD
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_EXECVE
select CLONE_BACKWARDS select CLONE_BACKWARDS
config EARLY_PRINTK config EARLY_PRINTK
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
#define __ARCH_WANT_COMPAT_SYS_SENDFILE #define __ARCH_WANT_COMPAT_SYS_SENDFILE
#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL #define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
#endif #endif
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -85,12 +85,6 @@ typedef struct { ...@@ -85,12 +85,6 @@ typedef struct {
#define SA_RESTORER 0x04000000U #define SA_RESTORER 0x04000000U
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -137,8 +137,6 @@ config S390 ...@@ -137,8 +137,6 @@ config S390
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select KTIME_SCALAR if 32BIT select KTIME_SCALAR if 32BIT
select HAVE_ARCH_SECCOMP_FILTER select HAVE_ARCH_SECCOMP_FILTER
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select CLONE_BACKWARDS2 select CLONE_BACKWARDS2
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/thread_info.h> #include <linux/thread_info.h>
#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64))
#define __SC_DELOUSE(t,v) (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v))
#define PSW32_MASK_PER 0x40000000UL #define PSW32_MASK_PER 0x40000000UL
#define PSW32_MASK_DAT 0x04000000UL #define PSW32_MASK_DAT 0x04000000UL
#define PSW32_MASK_IO 0x02000000UL #define PSW32_MASK_IO 0x02000000UL
......
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
# define __ARCH_WANT_COMPAT_SYS_TIME # define __ARCH_WANT_COMPAT_SYS_TIME
# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND # define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
# endif # endif
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -90,12 +90,6 @@ typedef unsigned long sigset_t; ...@@ -90,12 +90,6 @@ typedef unsigned long sigset_t;
#define SA_RESTORER 0x04000000 #define SA_RESTORER 0x04000000
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -13,8 +13,6 @@ config SCORE ...@@ -13,8 +13,6 @@ config SCORE
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_REL select MODULES_USE_ELF_REL
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select CLONE_BACKWARDS select CLONE_BACKWARDS
choice choice
......
...@@ -13,6 +13,7 @@ struct task_struct; ...@@ -13,6 +13,7 @@ struct task_struct;
#define instruction_pointer(regs) ((unsigned long)(regs)->cp0_epc) #define instruction_pointer(regs) ((unsigned long)(regs)->cp0_epc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(r) ((unsigned long)(r)->regs[0])
extern void do_syscall_trace(struct pt_regs *regs, int entryexit); extern void do_syscall_trace(struct pt_regs *regs, int entryexit);
extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *); extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *);
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#define __ARCH_WANT_SYSCALL_NO_FLAGS #define __ARCH_WANT_SYSCALL_NO_FLAGS
#define __ARCH_WANT_SYSCALL_OFF_T #define __ARCH_WANT_SYSCALL_OFF_T
#define __ARCH_WANT_SYSCALL_DEPRECATED #define __ARCH_WANT_SYSCALL_DEPRECATED
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
......
...@@ -40,8 +40,6 @@ config SUPERH ...@@ -40,8 +40,6 @@ config SUPERH
select GENERIC_STRNLEN_USER select GENERIC_STRNLEN_USER
select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
help help
The SuperH is a RISC processor targeted for use in embedded systems The SuperH is a RISC processor targeted for use in embedded systems
and consumer electronics; it was also used in the Sega Dreamcast and consumer electronics; it was also used in the Sega Dreamcast
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
# define __ARCH_WANT_SYS_SIGPENDING # define __ARCH_WANT_SYS_SIGPENDING
# define __ARCH_WANT_SYS_SIGPROCMASK # define __ARCH_WANT_SYS_SIGPROCMASK
# define __ARCH_WANT_SYS_RT_SIGACTION # define __ARCH_WANT_SYS_RT_SIGACTION
# define __ARCH_WANT_SYS_EXECVE
# define __ARCH_WANT_SYS_FORK # define __ARCH_WANT_SYS_FORK
# define __ARCH_WANT_SYS_VFORK # define __ARCH_WANT_SYS_VFORK
# define __ARCH_WANT_SYS_CLONE # define __ARCH_WANT_SYS_CLONE
......
...@@ -41,8 +41,6 @@ config SPARC ...@@ -41,8 +41,6 @@ config SPARC
select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER select GENERIC_STRNLEN_USER
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
config SPARC32 config SPARC32
def_bool !64BIT def_bool !64BIT
......
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
#define __ARCH_WANT_COMPAT_SYS_SENDFILE #define __ARCH_WANT_COMPAT_SYS_SENDFILE
#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL #define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
#endif #endif
#define __ARCH_WANT_SYS_EXECVE
/* /*
* "Conditional" syscalls * "Conditional" syscalls
......
...@@ -147,12 +147,6 @@ struct sigstack { ...@@ -147,12 +147,6 @@ struct sigstack {
#define SIG_UNBLOCK 0x02 /* for unblocking signals */ #define SIG_UNBLOCK 0x02 /* for unblocking signals */
#define SIG_SETMASK 0x04 /* for setting the signal mask */ #define SIG_SETMASK 0x04 /* for setting the signal mask */
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 4096 #define MINSIGSTKSZ 4096
#define SIGSTKSZ 16384 #define SIGSTKSZ 16384
......
...@@ -21,8 +21,6 @@ config TILE ...@@ -21,8 +21,6 @@ config TILE
select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_HAVE_NMI_SAFE_CMPXCHG
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
# FIXME: investigate whether we need/want these options. # FIXME: investigate whether we need/want these options.
# select HAVE_IOREMAP_PROT # select HAVE_IOREMAP_PROT
......
...@@ -35,6 +35,7 @@ typedef unsigned long pt_reg_t; ...@@ -35,6 +35,7 @@ typedef unsigned long pt_reg_t;
#define instruction_pointer(regs) ((regs)->pc) #define instruction_pointer(regs) ((regs)->pc)
#define profile_pc(regs) instruction_pointer(regs) #define profile_pc(regs) instruction_pointer(regs)
#define user_stack_pointer(regs) ((regs)->sp)
/* Does the process account for user or for system time? */ /* Does the process account for user or for system time? */
#define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL) #define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL)
......
...@@ -17,6 +17,5 @@ ...@@ -17,6 +17,5 @@
#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL #define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
#endif #endif
#define __ARCH_WANT_SYS_NEWFSTATAT #define __ARCH_WANT_SYS_NEWFSTATAT
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
...@@ -132,8 +132,3 @@ long sys_sigsuspend(int history0, int history1, old_sigset_t mask) ...@@ -132,8 +132,3 @@ long sys_sigsuspend(int history0, int history1, old_sigset_t mask)
siginitset(&blocked, mask); siginitset(&blocked, mask);
return sigsuspend(&blocked); return sigsuspend(&blocked);
} }
long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
{
return do_sigaltstack(uss, uoss, PT_REGS_SP(&current->thread.regs));
}
...@@ -16,8 +16,6 @@ config UNICORE32 ...@@ -16,8 +16,6 @@ config UNICORE32
select ARCH_WANT_FRAME_POINTERS select ARCH_WANT_FRAME_POINTERS
select GENERIC_IOMAP select GENERIC_IOMAP
select MODULES_USE_ELF_REL select MODULES_USE_ELF_REL
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
help help
UniCore-32 is 32-bit Instruction Set Architecture, UniCore-32 is 32-bit Instruction Set Architecture,
including a series of low-power-consumption RISC chip including a series of low-power-consumption RISC chip
......
...@@ -54,6 +54,7 @@ static inline int valid_user_regs(struct pt_regs *regs) ...@@ -54,6 +54,7 @@ static inline int valid_user_regs(struct pt_regs *regs)
} }
#define instruction_pointer(regs) ((regs)->UCreg_pc) #define instruction_pointer(regs) ((regs)->UCreg_pc)
#define user_stack_pointer(regs) ((regs)->UCreg_sp)
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif #endif
...@@ -12,5 +12,4 @@ ...@@ -12,5 +12,4 @@
/* Use the standard ABI for syscalls. */ /* Use the standard ABI for syscalls. */
#include <asm-generic/unistd.h> #include <asm-generic/unistd.h>
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
...@@ -110,11 +110,10 @@ config X86 ...@@ -110,11 +110,10 @@ config X86
select GENERIC_STRNLEN_USER select GENERIC_STRNLEN_USER
select HAVE_CONTEXT_TRACKING if X86_64 select HAVE_CONTEXT_TRACKING if X86_64
select HAVE_IRQ_TIME_ACCOUNTING select HAVE_IRQ_TIME_ACCOUNTING
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select MODULES_USE_ELF_REL if X86_32 select MODULES_USE_ELF_REL if X86_32
select MODULES_USE_ELF_RELA if X86_64 select MODULES_USE_ELF_RELA if X86_64
select CLONE_BACKWARDS if X86_32 select CLONE_BACKWARDS if X86_32
select GENERIC_SIGALTSTACK
config INSTRUCTION_DECODER config INSTRUCTION_DECODER
def_bool y def_bool y
......
...@@ -136,52 +136,6 @@ asmlinkage long sys32_sigsuspend(int history0, int history1, old_sigset_t mask) ...@@ -136,52 +136,6 @@ asmlinkage long sys32_sigsuspend(int history0, int history1, old_sigset_t mask)
return sigsuspend(&blocked); return sigsuspend(&blocked);
} }
asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
stack_ia32_t __user *uoss_ptr,
struct pt_regs *regs)
{
stack_t uss, uoss;
int ret, err = 0;
mm_segment_t seg;
if (uss_ptr) {
u32 ptr;
memset(&uss, 0, sizeof(stack_t));
if (!access_ok(VERIFY_READ, uss_ptr, sizeof(stack_ia32_t)))
return -EFAULT;
get_user_try {
get_user_ex(ptr, &uss_ptr->ss_sp);
get_user_ex(uss.ss_flags, &uss_ptr->ss_flags);
get_user_ex(uss.ss_size, &uss_ptr->ss_size);
} get_user_catch(err);
if (err)
return -EFAULT;
uss.ss_sp = compat_ptr(ptr);
}
seg = get_fs();
set_fs(KERNEL_DS);
ret = do_sigaltstack((stack_t __force __user *) (uss_ptr ? &uss : NULL),
(stack_t __force __user *) &uoss, regs->sp);
set_fs(seg);
if (ret >= 0 && uoss_ptr) {
if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)))
return -EFAULT;
put_user_try {
put_user_ex(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp);
put_user_ex(uoss.ss_flags, &uoss_ptr->ss_flags);
put_user_ex(uoss.ss_size, &uoss_ptr->ss_size);
} put_user_catch(err);
if (err)
ret = -EFAULT;
}
return ret;
}
/* /*
* Do a signal return; undo the signal stack. * Do a signal return; undo the signal stack.
*/ */
...@@ -292,7 +246,6 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs) ...@@ -292,7 +246,6 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
struct rt_sigframe_ia32 __user *frame; struct rt_sigframe_ia32 __user *frame;
sigset_t set; sigset_t set;
unsigned int ax; unsigned int ax;
struct pt_regs tregs;
frame = (struct rt_sigframe_ia32 __user *)(regs->sp - 4); frame = (struct rt_sigframe_ia32 __user *)(regs->sp - 4);
...@@ -306,8 +259,7 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs) ...@@ -306,8 +259,7 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
goto badframe; goto badframe;
tregs = *regs; if (compat_restore_altstack(&frame->uc.uc_stack))
if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, &tregs) == -EFAULT)
goto badframe; goto badframe;
return ax; return ax;
...@@ -515,10 +467,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -515,10 +467,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
else else
put_user_ex(0, &frame->uc.uc_flags); put_user_ex(0, &frame->uc.uc_flags);
put_user_ex(0, &frame->uc.uc_link); put_user_ex(0, &frame->uc.uc_link);
put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); err |= __compat_save_altstack(&frame->uc.uc_stack, regs->sp);
put_user_ex(sas_ss_flags(regs->sp),
&frame->uc.uc_stack.ss_flags);
put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
if (ka->sa.sa_flags & SA_RESTORER) if (ka->sa.sa_flags & SA_RESTORER)
restorer = ka->sa.sa_restorer; restorer = ka->sa.sa_restorer;
......
...@@ -464,7 +464,6 @@ GLOBAL(\label) ...@@ -464,7 +464,6 @@ GLOBAL(\label)
PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi
PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi
PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx
PTREGSCALL stub32_execve, compat_sys_execve, %rcx PTREGSCALL stub32_execve, compat_sys_execve, %rcx
PTREGSCALL stub32_fork, sys_fork, %rdi PTREGSCALL stub32_fork, sys_fork, %rdi
PTREGSCALL stub32_vfork, sys_vfork, %rdi PTREGSCALL stub32_vfork, sys_vfork, %rdi
......
...@@ -29,16 +29,10 @@ struct old_sigaction32 { ...@@ -29,16 +29,10 @@ struct old_sigaction32 {
unsigned int sa_restorer; /* Another 32 bit pointer */ unsigned int sa_restorer; /* Another 32 bit pointer */
}; };
typedef struct sigaltstack_ia32 {
unsigned int ss_sp;
int ss_flags;
unsigned int ss_size;
} stack_ia32_t;
struct ucontext_ia32 { struct ucontext_ia32 {
unsigned int uc_flags; unsigned int uc_flags;
unsigned int uc_link; unsigned int uc_link;
stack_ia32_t uc_stack; compat_stack_t uc_stack;
struct sigcontext_ia32 uc_mcontext; struct sigcontext_ia32 uc_mcontext;
compat_sigset_t uc_sigmask; /* mask last for extensibility */ compat_sigset_t uc_sigmask; /* mask last for extensibility */
}; };
...@@ -46,7 +40,7 @@ struct ucontext_ia32 { ...@@ -46,7 +40,7 @@ struct ucontext_ia32 {
struct ucontext_x32 { struct ucontext_x32 {
unsigned int uc_flags; unsigned int uc_flags;
unsigned int uc_link; unsigned int uc_link;
stack_ia32_t uc_stack; compat_stack_t uc_stack;
unsigned int uc__pad0; /* needed for alignment */ unsigned int uc__pad0; /* needed for alignment */
struct sigcontext uc_mcontext; /* the 64-bit sigcontext type */ struct sigcontext uc_mcontext; /* the 64-bit sigcontext type */
compat_sigset_t uc_sigmask; /* mask last for extensibility */ compat_sigset_t uc_sigmask; /* mask last for extensibility */
......
...@@ -133,6 +133,13 @@ static inline bool user_64bit_mode(struct pt_regs *regs) ...@@ -133,6 +133,13 @@ static inline bool user_64bit_mode(struct pt_regs *regs)
return regs->cs == __USER_CS || regs->cs == pv_info.extra_user_64bit_cs; return regs->cs == __USER_CS || regs->cs == pv_info.extra_user_64bit_cs;
#endif #endif
} }
#define current_user_stack_pointer() this_cpu_read(old_rsp)
/* ia32 vs. x32 difference */
#define compat_user_stack_pointer() \
(test_thread_flag(TIF_IA32) \
? current_pt_regs()->sp \
: this_cpu_read(old_rsp))
#endif #endif
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
......
...@@ -69,8 +69,6 @@ asmlinkage long sys32_fallocate(int, int, unsigned, ...@@ -69,8 +69,6 @@ asmlinkage long sys32_fallocate(int, int, unsigned,
/* ia32/ia32_signal.c */ /* ia32/ia32_signal.c */
asmlinkage long sys32_sigsuspend(int, int, old_sigset_t); asmlinkage long sys32_sigsuspend(int, int, old_sigset_t);
asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *,
stack_ia32_t __user *, struct pt_regs *);
asmlinkage long sys32_sigreturn(struct pt_regs *); asmlinkage long sys32_sigreturn(struct pt_regs *);
asmlinkage long sys32_rt_sigreturn(struct pt_regs *); asmlinkage long sys32_rt_sigreturn(struct pt_regs *);
......
...@@ -25,9 +25,6 @@ asmlinkage int sys_modify_ldt(int, void __user *, unsigned long); ...@@ -25,9 +25,6 @@ asmlinkage int sys_modify_ldt(int, void __user *, unsigned long);
/* kernel/signal.c */ /* kernel/signal.c */
long sys_rt_sigreturn(struct pt_regs *); long sys_rt_sigreturn(struct pt_regs *);
long sys_sigaltstack(const stack_t __user *, stack_t __user *,
struct pt_regs *);
/* kernel/tls.c */ /* kernel/tls.c */
asmlinkage int sys_set_thread_area(struct user_desc __user *); asmlinkage int sys_set_thread_area(struct user_desc __user *);
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
# define __ARCH_WANT_SYS_TIME # define __ARCH_WANT_SYS_TIME
# define __ARCH_WANT_SYS_UTIME # define __ARCH_WANT_SYS_UTIME
# define __ARCH_WANT_SYS_WAITPID # define __ARCH_WANT_SYS_WAITPID
# define __ARCH_WANT_SYS_EXECVE
# define __ARCH_WANT_SYS_FORK # define __ARCH_WANT_SYS_FORK
# define __ARCH_WANT_SYS_VFORK # define __ARCH_WANT_SYS_VFORK
# define __ARCH_WANT_SYS_CLONE # define __ARCH_WANT_SYS_CLONE
......
...@@ -87,12 +87,6 @@ typedef unsigned long sigset_t; ...@@ -87,12 +87,6 @@ typedef unsigned long sigset_t;
#define SA_RESTORER 0x04000000 #define SA_RESTORER 0x04000000
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -739,7 +739,6 @@ ENTRY(ptregs_##name) ; \ ...@@ -739,7 +739,6 @@ ENTRY(ptregs_##name) ; \
ENDPROC(ptregs_##name) ENDPROC(ptregs_##name)
PTREGSCALL1(iopl) PTREGSCALL1(iopl)
PTREGSCALL2(sigaltstack)
PTREGSCALL0(sigreturn) PTREGSCALL0(sigreturn)
PTREGSCALL0(rt_sigreturn) PTREGSCALL0(rt_sigreturn)
PTREGSCALL2(vm86) PTREGSCALL2(vm86)
......
...@@ -864,7 +864,6 @@ END(stub_\func) ...@@ -864,7 +864,6 @@ END(stub_\func)
FORK_LIKE clone FORK_LIKE clone
FORK_LIKE fork FORK_LIKE fork
FORK_LIKE vfork FORK_LIKE vfork
PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx
PTREGSCALL stub_iopl, sys_iopl, %rsi PTREGSCALL stub_iopl, sys_iopl, %rsi
ENTRY(ptregscall_common) ENTRY(ptregscall_common)
...@@ -913,8 +912,6 @@ ENTRY(stub_rt_sigreturn) ...@@ -913,8 +912,6 @@ ENTRY(stub_rt_sigreturn)
END(stub_rt_sigreturn) END(stub_rt_sigreturn)
#ifdef CONFIG_X86_X32_ABI #ifdef CONFIG_X86_X32_ABI
PTREGSCALL stub_x32_sigaltstack, sys32_sigaltstack, %rdx
ENTRY(stub_x32_rt_sigreturn) ENTRY(stub_x32_rt_sigreturn)
CFI_STARTPROC CFI_STARTPROC
addq $8, %rsp addq $8, %rsp
......
...@@ -364,10 +364,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -364,10 +364,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
else else
put_user_ex(0, &frame->uc.uc_flags); put_user_ex(0, &frame->uc.uc_flags);
put_user_ex(0, &frame->uc.uc_link); put_user_ex(0, &frame->uc.uc_link);
put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
put_user_ex(sas_ss_flags(regs->sp),
&frame->uc.uc_stack.ss_flags);
put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
/* Set up to return from userspace. */ /* Set up to return from userspace. */
restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn); restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn);
...@@ -414,7 +411,6 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -414,7 +411,6 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
struct rt_sigframe __user *frame; struct rt_sigframe __user *frame;
void __user *fp = NULL; void __user *fp = NULL;
int err = 0; int err = 0;
struct task_struct *me = current;
frame = get_sigframe(ka, regs, sizeof(struct rt_sigframe), &fp); frame = get_sigframe(ka, regs, sizeof(struct rt_sigframe), &fp);
...@@ -433,10 +429,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -433,10 +429,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
else else
put_user_ex(0, &frame->uc.uc_flags); put_user_ex(0, &frame->uc.uc_flags);
put_user_ex(0, &frame->uc.uc_link); put_user_ex(0, &frame->uc.uc_link);
put_user_ex(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp); err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
put_user_ex(sas_ss_flags(regs->sp),
&frame->uc.uc_stack.ss_flags);
put_user_ex(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
/* Set up to return from userspace. If provided, use a stub /* Set up to return from userspace. If provided, use a stub
already in userspace. */ already in userspace. */
...@@ -503,10 +496,7 @@ static int x32_setup_rt_frame(int sig, struct k_sigaction *ka, ...@@ -503,10 +496,7 @@ static int x32_setup_rt_frame(int sig, struct k_sigaction *ka,
else else
put_user_ex(0, &frame->uc.uc_flags); put_user_ex(0, &frame->uc.uc_flags);
put_user_ex(0, &frame->uc.uc_link); put_user_ex(0, &frame->uc.uc_link);
put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); err |= __compat_save_altstack(&frame->uc.uc_stack, regs->sp);
put_user_ex(sas_ss_flags(regs->sp),
&frame->uc.uc_stack.ss_flags);
put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
put_user_ex(0, &frame->uc.uc__pad0); put_user_ex(0, &frame->uc.uc__pad0);
if (ka->sa.sa_flags & SA_RESTORER) { if (ka->sa.sa_flags & SA_RESTORER) {
...@@ -603,13 +593,6 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, ...@@ -603,13 +593,6 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
} }
#endif /* CONFIG_X86_32 */ #endif /* CONFIG_X86_32 */
long
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
struct pt_regs *regs)
{
return do_sigaltstack(uss, uoss, regs->sp);
}
/* /*
* Do a signal return; undo the signal stack. * Do a signal return; undo the signal stack.
*/ */
...@@ -659,7 +642,7 @@ long sys_rt_sigreturn(struct pt_regs *regs) ...@@ -659,7 +642,7 @@ long sys_rt_sigreturn(struct pt_regs *regs)
if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
goto badframe; goto badframe;
if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT) if (restore_altstack(&frame->uc.uc_stack))
goto badframe; goto badframe;
return ax; return ax;
...@@ -865,7 +848,6 @@ asmlinkage long sys32_x32_rt_sigreturn(struct pt_regs *regs) ...@@ -865,7 +848,6 @@ asmlinkage long sys32_x32_rt_sigreturn(struct pt_regs *regs)
struct rt_sigframe_x32 __user *frame; struct rt_sigframe_x32 __user *frame;
sigset_t set; sigset_t set;
unsigned long ax; unsigned long ax;
struct pt_regs tregs;
frame = (struct rt_sigframe_x32 __user *)(regs->sp - 8); frame = (struct rt_sigframe_x32 __user *)(regs->sp - 8);
...@@ -879,8 +861,7 @@ asmlinkage long sys32_x32_rt_sigreturn(struct pt_regs *regs) ...@@ -879,8 +861,7 @@ asmlinkage long sys32_x32_rt_sigreturn(struct pt_regs *regs)
if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
goto badframe; goto badframe;
tregs = *regs; if (compat_restore_altstack(&frame->uc.uc_stack))
if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, &tregs) == -EFAULT)
goto badframe; goto badframe;
return ax; return ax;
......
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
183 i386 getcwd sys_getcwd 183 i386 getcwd sys_getcwd
184 i386 capget sys_capget 184 i386 capget sys_capget
185 i386 capset sys_capset 185 i386 capset sys_capset
186 i386 sigaltstack ptregs_sigaltstack stub32_sigaltstack 186 i386 sigaltstack sys_sigaltstack compat_sys_sigaltstack
187 i386 sendfile sys_sendfile sys32_sendfile 187 i386 sendfile sys_sendfile sys32_sendfile
188 i386 getpmsg 188 i386 getpmsg
189 i386 putpmsg 189 i386 putpmsg
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
128 64 rt_sigtimedwait sys_rt_sigtimedwait 128 64 rt_sigtimedwait sys_rt_sigtimedwait
129 64 rt_sigqueueinfo sys_rt_sigqueueinfo 129 64 rt_sigqueueinfo sys_rt_sigqueueinfo
130 common rt_sigsuspend sys_rt_sigsuspend 130 common rt_sigsuspend sys_rt_sigsuspend
131 64 sigaltstack stub_sigaltstack 131 64 sigaltstack sys_sigaltstack
132 common utime sys_utime 132 common utime sys_utime
133 common mknod sys_mknod 133 common mknod sys_mknod
134 64 uselib 134 64 uselib
...@@ -338,7 +338,7 @@ ...@@ -338,7 +338,7 @@
522 x32 rt_sigpending sys32_rt_sigpending 522 x32 rt_sigpending sys32_rt_sigpending
523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait 523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait
524 x32 rt_sigqueueinfo sys32_rt_sigqueueinfo 524 x32 rt_sigqueueinfo sys32_rt_sigqueueinfo
525 x32 sigaltstack stub_x32_sigaltstack 525 x32 sigaltstack compat_sys_sigaltstack
526 x32 timer_create compat_sys_timer_create 526 x32 timer_create compat_sys_timer_create
527 x32 mq_notify compat_sys_mq_notify 527 x32 mq_notify compat_sys_mq_notify
528 x32 kexec_load compat_sys_kexec_load 528 x32 kexec_load compat_sys_kexec_load
......
...@@ -13,8 +13,7 @@ endmenu ...@@ -13,8 +13,7 @@ endmenu
config UML_X86 config UML_X86
def_bool y def_bool y
select GENERIC_FIND_FIRST_BIT select GENERIC_FIND_FIRST_BIT
select GENERIC_KERNEL_THREAD select GENERIC_SIGALTSTACK
select GENERIC_KERNEL_EXECVE
config 64BIT config 64BIT
bool "64-bit kernel" if SUBARCH = "x86" bool "64-bit kernel" if SUBARCH = "x86"
......
...@@ -86,4 +86,5 @@ extern long arch_prctl(struct task_struct *task, int code, ...@@ -86,4 +86,5 @@ extern long arch_prctl(struct task_struct *task, int code,
unsigned long __user *addr); unsigned long __user *addr);
#endif #endif
#define user_stack_pointer(regs) PT_REGS_SP(regs)
#endif /* __UM_X86_PTRACE_H */ #endif /* __UM_X86_PTRACE_H */
...@@ -342,9 +342,7 @@ static int copy_ucontext_to_user(struct ucontext __user *uc, ...@@ -342,9 +342,7 @@ static int copy_ucontext_to_user(struct ucontext __user *uc,
{ {
int err = 0; int err = 0;
err |= put_user(current->sas_ss_sp, &uc->uc_stack.ss_sp); err |= __save_altstack(&uc->uc_stack, sp);
err |= put_user(sas_ss_flags(sp), &uc->uc_stack.ss_flags);
err |= put_user(current->sas_ss_size, &uc->uc_stack.ss_size);
err |= copy_sc_to_user(&uc->uc_mcontext, fp, &current->thread.regs, 0); err |= copy_sc_to_user(&uc->uc_mcontext, fp, &current->thread.regs, 0);
err |= copy_to_user(&uc->uc_sigmask, set, sizeof(*set)); err |= copy_to_user(&uc->uc_sigmask, set, sizeof(*set));
return err; return err;
...@@ -529,10 +527,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, ...@@ -529,10 +527,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
/* Create the ucontext. */ /* Create the ucontext. */
err |= __put_user(0, &frame->uc.uc_flags); err |= __put_user(0, &frame->uc.uc_flags);
err |= __put_user(0, &frame->uc.uc_link); err |= __put_user(0, &frame->uc.uc_link);
err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp); err |= __save_altstack(&frame->uc.uc_stack, PT_REGS_SP(regs));
err |= __put_user(sas_ss_flags(PT_REGS_SP(regs)),
&frame->uc.uc_stack.ss_flags);
err |= __put_user(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
err |= copy_sc_to_user(&frame->uc.uc_mcontext, &frame->fpstate, regs, err |= copy_sc_to_user(&frame->uc.uc_mcontext, &frame->fpstate, regs,
set->sig[0]); set->sig[0]);
err |= __put_user(&frame->fpstate, &frame->uc.uc_mcontext.fpstate); err |= __put_user(&frame->fpstate, &frame->uc.uc_mcontext.fpstate);
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#define ptregs_iopl sys_iopl #define ptregs_iopl sys_iopl
#define ptregs_vm86old sys_vm86old #define ptregs_vm86old sys_vm86old
#define ptregs_vm86 sys_vm86 #define ptregs_vm86 sys_vm86
#define ptregs_sigaltstack sys_sigaltstack
#define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ; #define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ;
#include <asm/syscalls_32.h> #include <asm/syscalls_32.h>
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#define stub_fork sys_fork #define stub_fork sys_fork
#define stub_vfork sys_vfork #define stub_vfork sys_vfork
#define stub_execve sys_execve #define stub_execve sys_execve
#define stub_sigaltstack sys_sigaltstack
#define stub_rt_sigreturn sys_rt_sigreturn #define stub_rt_sigreturn sys_rt_sigreturn
#define __SYSCALL_COMMON(nr, sym, compat) __SYSCALL_64(nr, sym, compat) #define __SYSCALL_COMMON(nr, sym, compat) __SYSCALL_64(nr, sym, compat)
......
...@@ -13,8 +13,6 @@ config XTENSA ...@@ -13,8 +13,6 @@ config XTENSA
select GENERIC_CPU_DEVICES select GENERIC_CPU_DEVICES
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_PCI_IOMAP select GENERIC_PCI_IOMAP
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_WANT_OPTIONAL_GPIOLIB
select CLONE_BACKWARDS select CLONE_BACKWARDS
select IRQ_DOMAIN select IRQ_DOMAIN
......
...@@ -63,6 +63,8 @@ struct pt_regs { ...@@ -63,6 +63,8 @@ struct pt_regs {
# define profile_pc(regs) instruction_pointer(regs) # define profile_pc(regs) instruction_pointer(regs)
# endif # endif
#define user_stack_pointer(regs) ((regs)->areg[1])
#else /* __ASSEMBLY__ */ #else /* __ASSEMBLY__ */
# include <asm/asm-offsets.h> # include <asm/asm-offsets.h>
......
#ifndef _XTENSA_UNISTD_H #ifndef _XTENSA_UNISTD_H
#define _XTENSA_UNISTD_H #define _XTENSA_UNISTD_H
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
......
...@@ -97,12 +97,6 @@ typedef struct { ...@@ -97,12 +97,6 @@ typedef struct {
#define SA_RESTORER 0x04000000 #define SA_RESTORER 0x04000000
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -1654,7 +1654,6 @@ int get_dumpable(struct mm_struct *mm) ...@@ -1654,7 +1654,6 @@ int get_dumpable(struct mm_struct *mm)
return __get_dumpable(mm->flags); return __get_dumpable(mm->flags);
} }
#ifdef __ARCH_WANT_SYS_EXECVE
SYSCALL_DEFINE3(execve, SYSCALL_DEFINE3(execve,
const char __user *, filename, const char __user *, filename,
const char __user *const __user *, argv, const char __user *const __user *, argv,
...@@ -1682,23 +1681,3 @@ asmlinkage long compat_sys_execve(const char __user * filename, ...@@ -1682,23 +1681,3 @@ asmlinkage long compat_sys_execve(const char __user * filename,
return error; return error;
} }
#endif #endif
#endif
#ifdef __ARCH_WANT_KERNEL_EXECVE
int kernel_execve(const char *filename,
const char *const argv[],
const char *const envp[])
{
int ret = do_execve(filename,
(const char __user *const __user *)argv,
(const char __user *const __user *)envp);
if (ret < 0)
return ret;
/*
* We were successful. We won't be returning to our caller, but
* instead to user space by manipulating the kernel stack.
*/
ret_from_kernel_execve(current_pt_regs());
}
#endif
...@@ -119,8 +119,4 @@ extern void install_exec_creds(struct linux_binprm *bprm); ...@@ -119,8 +119,4 @@ extern void install_exec_creds(struct linux_binprm *bprm);
extern void set_binfmt(struct linux_binfmt *new); extern void set_binfmt(struct linux_binfmt *new);
extern void free_bprm(struct linux_binprm *); extern void free_bprm(struct linux_binprm *);
#ifdef __ARCH_WANT_KERNEL_EXECVE
extern void ret_from_kernel_execve(struct pt_regs *normal) __noreturn;
#endif
#endif /* _LINUX_BINFMTS_H */ #endif /* _LINUX_BINFMTS_H */
...@@ -23,6 +23,61 @@ ...@@ -23,6 +23,61 @@
#define COMPAT_USE_64BIT_TIME 0 #define COMPAT_USE_64BIT_TIME 0
#endif #endif
#ifndef __SC_DELOUSE
#define __SC_DELOUSE(t,v) ((t)(unsigned long)(v))
#endif
#define __SC_CCAST1(t1, a1) __SC_DELOUSE(t1,a1)
#define __SC_CCAST2(t2, a2, ...) __SC_DELOUSE(t2,a2), __SC_CCAST1(__VA_ARGS__)
#define __SC_CCAST3(t3, a3, ...) __SC_DELOUSE(t3,a3), __SC_CCAST2(__VA_ARGS__)
#define __SC_CCAST4(t4, a4, ...) __SC_DELOUSE(t4,a4), __SC_CCAST3(__VA_ARGS__)
#define __SC_CCAST5(t5, a5, ...) __SC_DELOUSE(t5,a5), __SC_CCAST4(__VA_ARGS__)
#define __SC_CCAST6(t6, a6, ...) __SC_DELOUSE(t6,a6), __SC_CCAST5(__VA_ARGS__)
#define COMPAT_SYSCALL_DEFINE1(name, ...) \
COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
#define COMPAT_SYSCALL_DEFINE2(name, ...) \
COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
#define COMPAT_SYSCALL_DEFINE3(name, ...) \
COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
#define COMPAT_SYSCALL_DEFINE4(name, ...) \
COMPAT_SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
#define COMPAT_SYSCALL_DEFINE5(name, ...) \
COMPAT_SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
#define COMPAT_SYSCALL_DEFINE6(name, ...) \
COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__)); \
static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__)); \
asmlinkage long compat_SyS##name(__SC_LONG##x(__VA_ARGS__)) \
{ \
return (long) C_SYSC##name(__SC_CCAST##x(__VA_ARGS__)); \
} \
SYSCALL_ALIAS(compat_sys##name, compat_SyS##name); \
static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__))
#else /* CONFIG_HAVE_SYSCALL_WRAPPERS */
#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__))
#endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */
#ifndef compat_user_stack_pointer
#define compat_user_stack_pointer() current_user_stack_pointer()
#endif
#ifdef CONFIG_GENERIC_SIGALTSTACK
#ifndef compat_sigaltstack /* we'll need that for MIPS */
typedef struct compat_sigaltstack {
compat_uptr_t ss_sp;
int ss_flags;
compat_size_t ss_size;
} compat_stack_t;
#endif
#endif
#define compat_jiffies_to_clock_t(x) \ #define compat_jiffies_to_clock_t(x) \
(((unsigned long)(x) * COMPAT_USER_HZ) / HZ) (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
...@@ -587,6 +642,13 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, ...@@ -587,6 +642,13 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
compat_off_t __user *offset, compat_size_t count); compat_off_t __user *offset, compat_size_t count);
#ifdef CONFIG_GENERIC_SIGALTSTACK
asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
compat_stack_t __user *uoss_ptr);
int compat_restore_altstack(const compat_stack_t __user *uss);
int __compat_save_altstack(compat_stack_t __user *, unsigned long);
#endif
asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid,
struct compat_timespec __user *interval); struct compat_timespec __user *interval);
......
...@@ -344,6 +344,10 @@ static inline void user_single_step_siginfo(struct task_struct *tsk, ...@@ -344,6 +344,10 @@ static inline void user_single_step_siginfo(struct task_struct *tsk,
#define signal_pt_regs() task_pt_regs(current) #define signal_pt_regs() task_pt_regs(current)
#endif #endif
#ifndef current_user_stack_pointer
#define current_user_stack_pointer() user_stack_pointer(current_pt_regs())
#endif
extern int task_current_syscall(struct task_struct *target, long *callno, extern int task_current_syscall(struct task_struct *target, long *callno,
unsigned long args[6], unsigned int maxargs, unsigned long args[6], unsigned int maxargs,
unsigned long *sp, unsigned long *pc); unsigned long *sp, unsigned long *pc);
......
...@@ -2353,9 +2353,7 @@ extern int do_execve(const char *, ...@@ -2353,9 +2353,7 @@ extern int do_execve(const char *,
const char __user * const __user *); const char __user * const __user *);
extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
struct task_struct *fork_idle(int); struct task_struct *fork_idle(int);
#ifdef CONFIG_GENERIC_KERNEL_THREAD
extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
#endif
extern void set_task_comm(struct task_struct *tsk, char *from); extern void set_task_comm(struct task_struct *tsk, char *from);
extern char *get_task_comm(char *to, struct task_struct *tsk); extern char *get_task_comm(char *to, struct task_struct *tsk);
......
...@@ -385,4 +385,7 @@ int unhandled_signal(struct task_struct *tsk, int sig); ...@@ -385,4 +385,7 @@ int unhandled_signal(struct task_struct *tsk, int sig);
void signals_init(void); void signals_init(void);
int restore_altstack(const stack_t __user *);
int __save_altstack(stack_t __user *, unsigned long);
#endif /* _LINUX_SIGNAL_H */ #endif /* _LINUX_SIGNAL_H */
...@@ -63,6 +63,7 @@ struct getcpu_cache; ...@@ -63,6 +63,7 @@ struct getcpu_cache;
struct old_linux_dirent; struct old_linux_dirent;
struct perf_event_attr; struct perf_event_attr;
struct file_handle; struct file_handle;
struct sigaltstack;
#include <linux/types.h> #include <linux/types.h>
#include <linux/aio_abi.h> #include <linux/aio_abi.h>
...@@ -299,6 +300,11 @@ asmlinkage long sys_personality(unsigned int personality); ...@@ -299,6 +300,11 @@ asmlinkage long sys_personality(unsigned int personality);
asmlinkage long sys_sigpending(old_sigset_t __user *set); asmlinkage long sys_sigpending(old_sigset_t __user *set);
asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set, asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set,
old_sigset_t __user *oset); old_sigset_t __user *oset);
#ifdef CONFIG_GENERIC_SIGALTSTACK
asmlinkage long sys_sigaltstack(const struct sigaltstack __user *uss,
struct sigaltstack __user *uoss);
#endif
asmlinkage long sys_getitimer(int which, struct itimerval __user *value); asmlinkage long sys_getitimer(int which, struct itimerval __user *value);
asmlinkage long sys_setitimer(int which, asmlinkage long sys_setitimer(int which,
struct itimerval __user *value, struct itimerval __user *value,
...@@ -827,15 +833,6 @@ asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags, ...@@ -827,15 +833,6 @@ asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags,
const char __user *pathname); const char __user *pathname);
asmlinkage long sys_syncfs(int fd); asmlinkage long sys_syncfs(int fd);
#ifndef CONFIG_GENERIC_KERNEL_EXECVE
int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]);
#else
#define kernel_execve(filename, argv, envp) \
do_execve(filename, \
(const char __user *const __user *)argv, \
(const char __user *const __user *)envp)
#endif
asmlinkage long sys_fork(void); asmlinkage long sys_fork(void);
asmlinkage long sys_vfork(void); asmlinkage long sys_vfork(void);
#ifdef CONFIG_CLONE_BACKWARDS #ifdef CONFIG_CLONE_BACKWARDS
......
...@@ -80,12 +80,6 @@ ...@@ -80,12 +80,6 @@
* SA_RESTORER 0x04000000 * SA_RESTORER 0x04000000
*/ */
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048 #define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192 #define SIGSTKSZ 8192
......
...@@ -4,5 +4,7 @@ ...@@ -4,5 +4,7 @@
#include <asm/signal.h> #include <asm/signal.h>
#include <asm/siginfo.h> #include <asm/siginfo.h>
#define SS_ONSTACK 1
#define SS_DISABLE 2
#endif /* _UAPI_LINUX_SIGNAL_H */ #endif /* _UAPI_LINUX_SIGNAL_H */
...@@ -797,7 +797,9 @@ static void __init do_pre_smp_initcalls(void) ...@@ -797,7 +797,9 @@ static void __init do_pre_smp_initcalls(void)
static int run_init_process(const char *init_filename) static int run_init_process(const char *init_filename)
{ {
argv_init[0] = init_filename; argv_init[0] = init_filename;
return kernel_execve(init_filename, argv_init, envp_init); return do_execve(init_filename,
(const char __user *const __user *)argv_init,
(const char __user *const __user *)envp_init);
} }
static void __init kernel_init_freeable(void); static void __init kernel_init_freeable(void);
......
...@@ -1613,7 +1613,6 @@ long do_fork(unsigned long clone_flags, ...@@ -1613,7 +1613,6 @@ long do_fork(unsigned long clone_flags,
return nr; return nr;
} }
#ifdef CONFIG_GENERIC_KERNEL_THREAD
/* /*
* Create a kernel thread. * Create a kernel thread.
*/ */
...@@ -1622,7 +1621,6 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) ...@@ -1622,7 +1621,6 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
return do_fork(flags|CLONE_VM|CLONE_UNTRACED, (unsigned long)fn, return do_fork(flags|CLONE_VM|CLONE_UNTRACED, (unsigned long)fn,
(unsigned long)arg, NULL, NULL); (unsigned long)arg, NULL, NULL);
} }
#endif
#ifdef __ARCH_WANT_SYS_FORK #ifdef __ARCH_WANT_SYS_FORK
SYSCALL_DEFINE0(fork) SYSCALL_DEFINE0(fork)
......
...@@ -219,9 +219,9 @@ static int ____call_usermodehelper(void *data) ...@@ -219,9 +219,9 @@ static int ____call_usermodehelper(void *data)
commit_creds(new); commit_creds(new);
retval = kernel_execve(sub_info->path, retval = do_execve(sub_info->path,
(const char *const *)sub_info->argv, (const char __user *const __user *)sub_info->argv,
(const char *const *)sub_info->envp); (const char __user *const __user *)sub_info->envp);
if (!retval) if (!retval)
return 0; return 0;
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/nsproxy.h> #include <linux/nsproxy.h>
#include <linux/user_namespace.h> #include <linux/user_namespace.h>
#include <linux/uprobes.h> #include <linux/uprobes.h>
#include <linux/compat.h>
#define CREATE_TRACE_POINTS #define CREATE_TRACE_POINTS
#include <trace/events/signal.h> #include <trace/events/signal.h>
...@@ -3094,6 +3095,79 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s ...@@ -3094,6 +3095,79 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
out: out:
return error; return error;
} }
#ifdef CONFIG_GENERIC_SIGALTSTACK
SYSCALL_DEFINE2(sigaltstack,const stack_t __user *,uss, stack_t __user *,uoss)
{
return do_sigaltstack(uss, uoss, current_user_stack_pointer());
}
#endif
int restore_altstack(const stack_t __user *uss)
{
int err = do_sigaltstack(uss, NULL, current_user_stack_pointer());
/* squash all but EFAULT for now */
return err == -EFAULT ? err : 0;
}
int __save_altstack(stack_t __user *uss, unsigned long sp)
{
struct task_struct *t = current;
return __put_user((void __user *)t->sas_ss_sp, &uss->ss_sp) |
__put_user(sas_ss_flags(sp), &uss->ss_flags) |
__put_user(t->sas_ss_size, &uss->ss_size);
}
#ifdef CONFIG_COMPAT
#ifdef CONFIG_GENERIC_SIGALTSTACK
asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
compat_stack_t __user *uoss_ptr)
{
stack_t uss, uoss;
int ret;
mm_segment_t seg;
if (uss_ptr) {
compat_stack_t uss32;
memset(&uss, 0, sizeof(stack_t));
if (copy_from_user(&uss32, uss_ptr, sizeof(compat_stack_t)))
return -EFAULT;
uss.ss_sp = compat_ptr(uss32.ss_sp);
uss.ss_flags = uss32.ss_flags;
uss.ss_size = uss32.ss_size;
}
seg = get_fs();
set_fs(KERNEL_DS);
ret = do_sigaltstack((stack_t __force __user *) (uss_ptr ? &uss : NULL),
(stack_t __force __user *) &uoss,
compat_user_stack_pointer());
set_fs(seg);
if (ret >= 0 && uoss_ptr) {
if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(compat_stack_t)) ||
__put_user(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp) ||
__put_user(uoss.ss_flags, &uoss_ptr->ss_flags) ||
__put_user(uoss.ss_size, &uoss_ptr->ss_size))
ret = -EFAULT;
}
return ret;
}
int compat_restore_altstack(const compat_stack_t __user *uss)
{
int err = compat_sys_sigaltstack(uss, NULL);
/* squash all but -EFAULT for now */
return err == -EFAULT ? err : 0;
}
int __compat_save_altstack(compat_stack_t __user *uss, unsigned long sp)
{
struct task_struct *t = current;
return __put_user(ptr_to_compat((void __user *)t->sas_ss_sp), &uss->ss_sp) |
__put_user(sas_ss_flags(sp), &uss->ss_flags) |
__put_user(t->sas_ss_size, &uss->ss_size);
}
#endif
#endif
#ifdef __ARCH_WANT_SYS_SIGPENDING #ifdef __ARCH_WANT_SYS_SIGPENDING
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment