From fe9c1db2cfc363cd30ecfe6480481b280abf8c0a Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 25 Dec 2012 14:31:38 -0500 Subject: generic compat_sys_rt_sigpending() conditional on GENERIC_COMPAT_RT_SIGPENDING; by the end of that series it will become the same thing as COMPAT and conditional will die out. Signed-off-by: Al Viro --- include/linux/signal.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/linux/signal.h') diff --git a/include/linux/signal.h b/include/linux/signal.h index 0a89ffc48466..786bd99fde65 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -243,7 +243,6 @@ extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, siginfo_t *info); -extern long do_sigpending(void __user *, unsigned long); extern int do_sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *); extern int sigprocmask(int, sigset_t *, sigset_t *); -- cgit v1.2.3 From 9aae8fc05d2d130797be436eb7cae29c32710193 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 24 Dec 2012 23:12:04 -0500 Subject: switch rt_tgsigqueueinfo to COMPAT_SYSCALL_DEFINE C ABI violations on sparc, ppc and mips Signed-off-by: Al Viro --- include/linux/signal.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/linux/signal.h') diff --git a/include/linux/signal.h b/include/linux/signal.h index 786bd99fde65..ed1e71f1aac7 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -241,8 +241,6 @@ extern int do_send_sig_info(int sig, struct siginfo *info, struct task_struct *p, bool group); extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); -extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, - siginfo_t *info); extern int do_sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *); extern int sigprocmask(int, sigset_t *, sigset_t *); -- cgit v1.2.3 From 92a3ce4a1e0047215aa0a0b30cc333bd32b866a8 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 25 Nov 2012 21:20:05 -0500 Subject: consolidate declarations of k_sigaction Only alpha and sparc are unusual - they have ka_restorer in it. And nobody needs that exposed to userland. Signed-off-by: Al Viro --- include/linux/signal.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/linux/signal.h') diff --git a/include/linux/signal.h b/include/linux/signal.h index ed1e71f1aac7..01451a156ff7 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -249,6 +249,13 @@ extern void __set_current_blocked(const sigset_t *); extern int show_unhandled_signals; extern int sigsuspend(sigset_t *); +struct k_sigaction { + struct sigaction sa; +#ifdef __ARCH_HAS_KA_RESTORER + __sigrestore_t ka_restorer; +#endif +}; + extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping); extern void exit_signals(struct task_struct *tsk); -- cgit v1.2.3 From 574c4866e33d648520a8bd5bf6f573ea6e554e88 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 25 Nov 2012 22:24:19 -0500 Subject: consolidate kernel-side struct sigaction declarations Signed-off-by: Al Viro --- include/linux/signal.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/linux/signal.h') diff --git a/include/linux/signal.h b/include/linux/signal.h index 01451a156ff7..0b6878e882da 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -249,6 +249,20 @@ extern void __set_current_blocked(const sigset_t *); extern int show_unhandled_signals; extern int sigsuspend(sigset_t *); +struct sigaction { +#ifndef __ARCH_HAS_ODD_SIGACTION + __sighandler_t sa_handler; + unsigned long sa_flags; +#else + unsigned long sa_flags; + __sighandler_t sa_handler; +#endif +#ifdef __ARCH_HAS_SA_RESTORER + __sigrestore_t sa_restorer; +#endif + sigset_t sa_mask; /* mask last for extensibility */ +}; + struct k_sigaction { struct sigaction sa; #ifdef __ARCH_HAS_KA_RESTORER -- cgit v1.2.3 From 495dfbf767553980dbd40a19a96a8ca5fa1be616 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 25 Dec 2012 19:09:45 -0500 Subject: generic sys_sigaction() and compat_sys_sigaction() conditional on OLD_SIGACTION/COMPAT_OLD_SIGACTION Signed-off-by: Al Viro --- include/linux/signal.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/linux/signal.h') diff --git a/include/linux/signal.h b/include/linux/signal.h index 0b6878e882da..e28e8d455d6e 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -269,6 +269,15 @@ struct k_sigaction { __sigrestore_t ka_restorer; #endif }; + +#ifdef CONFIG_OLD_SIGACTION +struct old_sigaction { + __sighandler_t sa_handler; + old_sigset_t sa_mask; + unsigned long sa_flags; + __sigrestore_t sa_restorer; +}; +#endif extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping); -- cgit v1.2.3 From ca86b5dce213f52c7538932740f83cafb2c34547 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 7 Nov 2012 15:09:38 -0500 Subject: new helper: get_signal() On success get_signal_to_deliver() fills k_sigaction and siginfo. _All_ users pass it addresses of the local variables sitting in the same function. Then they proceed to pass those addresses pretty much in tandem to a bunch of helper functions; again, all callers of those helpers are passing them such a pair, and one that had been through get_signal_to_deliver() at that. The obvious cleanup: introduce a new type that would contain a pair (struct ksignal) and begin switching to using it. Turns out that it's convenient to store the signal number in the same object. New helper, taking that sucker is a wrapper for get_signal_to_deliver(); takes struct ksignal * and returns bool. On success fills ksignal with the information for signal handler to be invoked. For now it's a macro (to avoid header ordering headache), but eventually it'll be a function in kernel/signal.c, with get_signal_to_deliver() folded into it. Signed-off-by: Al Viro --- include/linux/signal.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/linux/signal.h') diff --git a/include/linux/signal.h b/include/linux/signal.h index e28e8d455d6e..7c2744198dba 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -279,10 +279,28 @@ struct old_sigaction { }; #endif +struct ksignal { + struct k_sigaction ka; + siginfo_t info; + int sig; +}; + extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping); extern void exit_signals(struct task_struct *tsk); +/* + * Eventually that'll replace get_signal_to_deliver(); macro for now, + * to avoid nastiness with include order. + */ +#define get_signal(ksig) \ +({ \ + struct ksignal *p = (ksig); \ + p->sig = get_signal_to_deliver(&p->info, &p->ka, \ + signal_pt_regs(), NULL);\ + p->sig > 0; \ +}) + extern struct kmem_cache *sighand_cachep; int unhandled_signal(struct task_struct *tsk, int sig); -- cgit v1.2.3 From 2ce5da17570771330f44ac993b77749debf7954b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 7 Nov 2012 15:11:25 -0500 Subject: new helper: signal_setup_done() usual "call force_sigsegv or signal_delivered" logics. Takes ksignal instead of separate siginfo/k_sigaction. Signed-off-by: Al Viro --- include/linux/signal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/signal.h') diff --git a/include/linux/signal.h b/include/linux/signal.h index 7c2744198dba..a2dcb94ea49d 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -286,6 +286,7 @@ struct ksignal { }; extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); +extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping); extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping); extern void exit_signals(struct task_struct *tsk); -- cgit v1.2.3