Skip to content

Commit eaca6ea

Browse files
author
Al Viro
committed
sanitize rt_sigaction() situation a bit
Switch from __ARCH_WANT_SYS_RT_SIGACTION to opposite (!CONFIG_ODD_RT_SIGACTION); the only two architectures that need it are alpha and sparc. The reason for use of CONFIG_... instead of __ARCH_... is that it's needed only kernel-side and doing it that way avoids a mess with include order on many architectures. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 3778407 commit eaca6ea

11 files changed

Lines changed: 20 additions & 30 deletions

File tree

‎arch/Kconfig‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,4 +373,9 @@ config CLONE_BACKWARDS2
373373
help
374374
Architecture has the first two arguments of clone(2) swapped.
375375

376+
config ODD_RT_SIGACTION
377+
bool
378+
help
379+
Architecture has unusual rt_sigaction(2) arguments
380+
376381
source "kernel/gcov/Kconfig"

‎arch/alpha/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ config ALPHA
2323
select HAVE_MOD_ARCH_SPECIFIC
2424
select MODULES_USE_ELF_RELA
2525
select GENERIC_SIGALTSTACK
26+
select ODD_RT_SIGACTION
2627
help
2728
The Alpha is a 64-bit general-purpose processor designed and
2829
marketed by the Digital Equipment Corporation of blessed memory,

‎arch/ia64/include/asm/unistd.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ asmlinkage unsigned long sys_mmap2(
4949
struct pt_regs;
5050
struct sigaction;
5151
asmlinkage long sys_ia64_pipe(void);
52-
asmlinkage long sys_rt_sigaction(int sig,
53-
const struct sigaction __user *act,
54-
struct sigaction __user *oact,
55-
size_t sigsetsize);
5652

5753
/*
5854
* "Conditional" syscalls

‎arch/powerpc/include/asm/syscalls.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len,
1919
unsigned long fd, unsigned long pgoff);
2020
asmlinkage long sys_pipe(int __user *fildes);
2121
asmlinkage long sys_pipe2(int __user *fildes, int flags);
22-
asmlinkage long sys_rt_sigaction(int sig,
23-
const struct sigaction __user *act,
24-
struct sigaction __user *oact, size_t sigsetsize);
2522
asmlinkage long ppc64_personality(unsigned long personality);
2623
asmlinkage int ppc_rtas(struct rtas_args __user *uargs);
2724
asmlinkage time_t sys64_time(time_t __user * tloc);

‎arch/sparc/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ config SPARC
4141
select GENERIC_STRNCPY_FROM_USER
4242
select GENERIC_STRNLEN_USER
4343
select MODULES_USE_ELF_RELA
44+
select ODD_RT_SIGACTION
4445

4546
config SPARC32
4647
def_bool !64BIT

‎arch/sparc/kernel/sys_sparc_32.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,11 @@ sparc_sigaction (int sig, const struct old_sigaction __user *act,
197197
return ret;
198198
}
199199

200-
asmlinkage long
201-
sys_rt_sigaction(int sig,
202-
const struct sigaction __user *act,
203-
struct sigaction __user *oact,
204-
void __user *restorer,
205-
size_t sigsetsize)
200+
SYSCALL_DEFINE5(rt_sigaction, int, sig,
201+
const struct sigaction __user *, act,
202+
struct sigaction __user *, oact,
203+
void __user *, restorer,
204+
size_t, sigsetsize)
206205
{
207206
struct k_sigaction new_ka, old_ka;
208207
int ret;

‎arch/x86/um/shared/sysdep/syscalls_32.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88

99
typedef long syscall_handler_t(struct pt_regs);
1010

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-
1611
extern syscall_handler_t *sys_call_table[];
1712

1813
#define EXECUTE_SYSCALL(syscall, regs) \

‎arch/xtensa/include/asm/syscall.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@
99
*/
1010

1111
struct pt_regs;
12-
struct sigaction;
1312
asmlinkage long xtensa_ptrace(long, long, long, long);
1413
asmlinkage long xtensa_sigreturn(struct pt_regs*);
1514
asmlinkage long xtensa_rt_sigreturn(struct pt_regs*);
1615
asmlinkage long xtensa_sigaltstack(struct pt_regs *regs);
17-
asmlinkage long sys_rt_sigaction(int,
18-
const struct sigaction __user *,
19-
struct sigaction __user *,
20-
size_t);
2116
asmlinkage long xtensa_shmat(int, char __user *, int);
2217
asmlinkage long xtensa_fadvise64_64(int, int,
2318
unsigned long long, unsigned long long);

‎include/asm-generic/syscalls.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,4 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs);
3636
asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize);
3737
#endif
3838

39-
#ifndef sys_rt_sigaction
40-
asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act,
41-
struct sigaction __user *oact, size_t sigsetsize);
42-
#endif
43-
4439
#endif /* __ASM_GENERIC_SYSCALLS_H */

‎include/linux/syscalls.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,12 @@ asmlinkage long sys_init_module(void __user *umod, unsigned long len,
377377
asmlinkage long sys_delete_module(const char __user *name_user,
378378
unsigned int flags);
379379

380+
#ifndef CONFIG_ODD_RT_SIGACTION
381+
asmlinkage long sys_rt_sigaction(int,
382+
const struct sigaction __user *,
383+
struct sigaction __user *,
384+
size_t);
385+
#endif
380386
asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set,
381387
sigset_t __user *oset, size_t sigsetsize);
382388
asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize);

0 commit comments

Comments
 (0)