diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-23 21:50:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-23 21:50:11 -0500 |
commit | 9e2d59ad580d590134285f361a0e80f0e98c0207 (patch) | |
tree | f3232be75781484193413f32ec82c21f6d8eb76e /arch/x86/um | |
parent | 5ce1a70e2f00f0bce0cab57f798ca354b9496169 (diff) | |
parent | 235b80226b986dabcbba844968f7807866bd0bfe (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull signal handling cleanups from Al Viro:
"This is the first pile; another one will come a bit later and will
contain SYSCALL_DEFINE-related patches.
- a bunch of signal-related syscalls (both native and compat)
unified.
- a bunch of compat syscalls switched to COMPAT_SYSCALL_DEFINE
(fixing several potential problems with missing argument
validation, while we are at it)
- a lot of now-pointless wrappers killed
- a couple of architectures (cris and hexagon) forgot to save
altstack settings into sigframe, even though they used the
(uninitialized) values in sigreturn; fixed.
- microblaze fixes for delivery of multiple signals arriving at once
- saner set of helpers for signal delivery introduced, several
architectures switched to using those."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (143 commits)
x86: convert to ksignal
sparc: convert to ksignal
arm: switch to struct ksignal * passing
alpha: pass k_sigaction and siginfo_t using ksignal pointer
burying unused conditionals
make do_sigaltstack() static
arm64: switch to generic old sigaction() (compat-only)
arm64: switch to generic compat rt_sigaction()
arm64: switch compat to generic old sigsuspend
arm64: switch to generic compat rt_sigqueueinfo()
arm64: switch to generic compat rt_sigpending()
arm64: switch to generic compat rt_sigprocmask()
arm64: switch to generic sigaltstack
sparc: switch to generic old sigsuspend
sparc: COMPAT_SYSCALL_DEFINE does all sign-extension as well as SYSCALL_DEFINE
sparc: kill sign-extending wrappers for native syscalls
kill sparc32_open()
sparc: switch to use of generic old sigaction
sparc: switch sys_compat_rt_sigaction() to COMPAT_SYSCALL_DEFINE
mips: switch to generic sys_fork() and sys_clone()
...
Diffstat (limited to 'arch/x86/um')
-rw-r--r-- | arch/x86/um/Kconfig | 3 | ||||
-rw-r--r-- | arch/x86/um/Makefile | 4 | ||||
-rw-r--r-- | arch/x86/um/shared/sysdep/syscalls_32.h | 5 | ||||
-rw-r--r-- | arch/x86/um/signal.c | 15 | ||||
-rw-r--r-- | arch/x86/um/sys_call_table_32.c | 4 | ||||
-rw-r--r-- | arch/x86/um/syscalls_32.c | 38 |
6 files changed, 6 insertions, 63 deletions
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index 21a13ce1d751..14ef8d1dbc33 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig | |||
@@ -13,7 +13,6 @@ endmenu | |||
13 | config UML_X86 | 13 | config UML_X86 |
14 | def_bool y | 14 | def_bool y |
15 | select GENERIC_FIND_FIRST_BIT | 15 | select GENERIC_FIND_FIRST_BIT |
16 | select GENERIC_SIGALTSTACK | ||
17 | 16 | ||
18 | config 64BIT | 17 | config 64BIT |
19 | bool "64-bit kernel" if SUBARCH = "x86" | 18 | bool "64-bit kernel" if SUBARCH = "x86" |
@@ -25,6 +24,8 @@ config X86_32 | |||
25 | select ARCH_WANT_IPC_PARSE_VERSION | 24 | select ARCH_WANT_IPC_PARSE_VERSION |
26 | select MODULES_USE_ELF_REL | 25 | select MODULES_USE_ELF_REL |
27 | select CLONE_BACKWARDS | 26 | select CLONE_BACKWARDS |
27 | select OLD_SIGSUSPEND3 | ||
28 | select OLD_SIGACTION | ||
28 | 29 | ||
29 | config X86_64 | 30 | config X86_64 |
30 | def_bool 64BIT | 31 | def_bool 64BIT |
diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile index 5d065b2222d3..eafa324eb7a5 100644 --- a/arch/x86/um/Makefile +++ b/arch/x86/um/Makefile | |||
@@ -10,7 +10,7 @@ endif | |||
10 | 10 | ||
11 | obj-y = bug.o bugs_$(BITS).o delay.o fault.o ksyms.o ldt.o \ | 11 | obj-y = bug.o bugs_$(BITS).o delay.o fault.o ksyms.o ldt.o \ |
12 | ptrace_$(BITS).o ptrace_user.o setjmp_$(BITS).o signal.o \ | 12 | ptrace_$(BITS).o ptrace_user.o setjmp_$(BITS).o signal.o \ |
13 | stub_$(BITS).o stub_segv.o syscalls_$(BITS).o \ | 13 | stub_$(BITS).o stub_segv.o \ |
14 | sys_call_table_$(BITS).o sysrq_$(BITS).o tls_$(BITS).o \ | 14 | sys_call_table_$(BITS).o sysrq_$(BITS).o tls_$(BITS).o \ |
15 | mem_$(BITS).o subarch.o os-$(OS)/ | 15 | mem_$(BITS).o subarch.o os-$(OS)/ |
16 | 16 | ||
@@ -25,7 +25,7 @@ subarch-$(CONFIG_HIGHMEM) += ../mm/highmem_32.o | |||
25 | 25 | ||
26 | else | 26 | else |
27 | 27 | ||
28 | obj-y += vdso/ | 28 | obj-y += syscalls_64.o vdso/ |
29 | 29 | ||
30 | subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../lib/thunk_64.o \ | 30 | subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../lib/thunk_64.o \ |
31 | ../lib/rwsem.o | 31 | ../lib/rwsem.o |
diff --git a/arch/x86/um/shared/sysdep/syscalls_32.h b/arch/x86/um/shared/sysdep/syscalls_32.h index 8436079be914..68fd2cf526fd 100644 --- a/arch/x86/um/shared/sysdep/syscalls_32.h +++ b/arch/x86/um/shared/sysdep/syscalls_32.h | |||
@@ -8,11 +8,6 @@ | |||
8 | 8 | ||
9 | typedef long syscall_handler_t(struct pt_regs); | 9 | typedef long syscall_handler_t(struct pt_regs); |
10 | 10 | ||
11 | /* Not declared on x86, incompatible declarations on x86_64, so these have | ||
12 | * to go here rather than in sys_call_table.c | ||
13 | */ | ||
14 | extern syscall_handler_t sys_rt_sigaction; | ||
15 | |||
16 | extern syscall_handler_t *sys_call_table[]; | 11 | extern syscall_handler_t *sys_call_table[]; |
17 | 12 | ||
18 | #define EXECUTE_SYSCALL(syscall, regs) \ | 13 | #define EXECUTE_SYSCALL(syscall, regs) \ |
diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c index 71cef48ea5cd..ae7319db18ee 100644 --- a/arch/x86/um/signal.c +++ b/arch/x86/um/signal.c | |||
@@ -464,7 +464,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, | |||
464 | return 0; | 464 | return 0; |
465 | } | 465 | } |
466 | 466 | ||
467 | long sys_sigreturn(struct pt_regs *regs) | 467 | long sys_sigreturn(void) |
468 | { | 468 | { |
469 | unsigned long sp = PT_REGS_SP(¤t->thread.regs); | 469 | unsigned long sp = PT_REGS_SP(¤t->thread.regs); |
470 | struct sigframe __user *frame = (struct sigframe __user *)(sp - 8); | 470 | struct sigframe __user *frame = (struct sigframe __user *)(sp - 8); |
@@ -577,7 +577,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, | |||
577 | } | 577 | } |
578 | #endif | 578 | #endif |
579 | 579 | ||
580 | long sys_rt_sigreturn(struct pt_regs *regs) | 580 | long sys_rt_sigreturn(void) |
581 | { | 581 | { |
582 | unsigned long sp = PT_REGS_SP(¤t->thread.regs); | 582 | unsigned long sp = PT_REGS_SP(¤t->thread.regs); |
583 | struct rt_sigframe __user *frame = | 583 | struct rt_sigframe __user *frame = |
@@ -601,14 +601,3 @@ long sys_rt_sigreturn(struct pt_regs *regs) | |||
601 | force_sig(SIGSEGV, current); | 601 | force_sig(SIGSEGV, current); |
602 | return 0; | 602 | return 0; |
603 | } | 603 | } |
604 | |||
605 | #ifdef CONFIG_X86_32 | ||
606 | long ptregs_sigreturn(void) | ||
607 | { | ||
608 | return sys_sigreturn(NULL); | ||
609 | } | ||
610 | long ptregs_rt_sigreturn(void) | ||
611 | { | ||
612 | return sys_rt_sigreturn(NULL); | ||
613 | } | ||
614 | #endif | ||
diff --git a/arch/x86/um/sys_call_table_32.c b/arch/x86/um/sys_call_table_32.c index a0c3b0d1a122..531d4269e2e3 100644 --- a/arch/x86/um/sys_call_table_32.c +++ b/arch/x86/um/sys_call_table_32.c | |||
@@ -24,10 +24,6 @@ | |||
24 | 24 | ||
25 | #define old_mmap sys_old_mmap | 25 | #define old_mmap sys_old_mmap |
26 | 26 | ||
27 | #define ptregs_iopl sys_iopl | ||
28 | #define ptregs_vm86old sys_vm86old | ||
29 | #define ptregs_vm86 sys_vm86 | ||
30 | |||
31 | #define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ; | 27 | #define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ; |
32 | #include <asm/syscalls_32.h> | 28 | #include <asm/syscalls_32.h> |
33 | 29 | ||
diff --git a/arch/x86/um/syscalls_32.c b/arch/x86/um/syscalls_32.c deleted file mode 100644 index e8bcea99acdb..000000000000 --- a/arch/x86/um/syscalls_32.c +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #include <linux/syscalls.h> | ||
7 | #include <sysdep/syscalls.h> | ||
8 | |||
9 | long sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
10 | struct old_sigaction __user *oact) | ||
11 | { | ||
12 | struct k_sigaction new_ka, old_ka; | ||
13 | int ret; | ||
14 | |||
15 | if (act) { | ||
16 | old_sigset_t mask; | ||
17 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
18 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
19 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
20 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
21 | __get_user(mask, &act->sa_mask)) | ||
22 | return -EFAULT; | ||
23 | siginitset(&new_ka.sa.sa_mask, mask); | ||
24 | } | ||
25 | |||
26 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
27 | |||
28 | if (!ret && oact) { | ||
29 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
30 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
31 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
32 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
33 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
34 | return -EFAULT; | ||
35 | } | ||
36 | |||
37 | return ret; | ||
38 | } | ||