diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-27 13:58:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:58:51 -0400 |
commit | 77097ae503b170120ab66dd1d547f8577193f91f (patch) | |
tree | bee5b2e8d91b9ec8ab74c58cbec1796c7bacc2e5 /arch | |
parent | edd63a2763bdae0daa4f0a4d4c5d61d1154352a5 (diff) |
most of set_current_blocked() callers want SIGKILL/SIGSTOP removed from set
Only 3 out of 63 do not. Renamed the current variant to __set_current_blocked(),
added set_current_blocked() that will exclude unblockable signals, switched
open-coded instances to it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
42 files changed, 2 insertions, 133 deletions
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c index bb45a8813393..48c4df2389ac 100644 --- a/arch/alpha/kernel/signal.c +++ b/arch/alpha/kernel/signal.c | |||
@@ -226,7 +226,6 @@ do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs, | |||
226 | if (__get_user(set.sig[0], &sc->sc_mask)) | 226 | if (__get_user(set.sig[0], &sc->sc_mask)) |
227 | goto give_sigsegv; | 227 | goto give_sigsegv; |
228 | 228 | ||
229 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
230 | set_current_blocked(&set); | 229 | set_current_blocked(&set); |
231 | 230 | ||
232 | if (restore_sigcontext(sc, regs, sw)) | 231 | if (restore_sigcontext(sc, regs, sw)) |
@@ -261,7 +260,6 @@ do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs, | |||
261 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 260 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
262 | goto give_sigsegv; | 261 | goto give_sigsegv; |
263 | 262 | ||
264 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
265 | set_current_blocked(&set); | 263 | set_current_blocked(&set); |
266 | 264 | ||
267 | if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw)) | 265 | if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw)) |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 7f9abd75fc2e..c126eba8411d 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -22,8 +22,6 @@ | |||
22 | 22 | ||
23 | #include "signal.h" | 23 | #include "signal.h" |
24 | 24 | ||
25 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
26 | |||
27 | /* | 25 | /* |
28 | * For ARM syscalls, we encode the syscall number into the instruction. | 26 | * For ARM syscalls, we encode the syscall number into the instruction. |
29 | */ | 27 | */ |
@@ -210,10 +208,8 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf) | |||
210 | int err; | 208 | int err; |
211 | 209 | ||
212 | err = __copy_from_user(&set, &sf->uc.uc_sigmask, sizeof(set)); | 210 | err = __copy_from_user(&set, &sf->uc.uc_sigmask, sizeof(set)); |
213 | if (err == 0) { | 211 | if (err == 0) |
214 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
215 | set_current_blocked(&set); | 212 | set_current_blocked(&set); |
216 | } | ||
217 | 213 | ||
218 | __get_user_error(regs->ARM_r0, &sf->uc.uc_mcontext.arm_r0, err); | 214 | __get_user_error(regs->ARM_r0, &sf->uc.uc_mcontext.arm_r0, err); |
219 | __get_user_error(regs->ARM_r1, &sf->uc.uc_mcontext.arm_r1, err); | 215 | __get_user_error(regs->ARM_r1, &sf->uc.uc_mcontext.arm_r1, err); |
diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c index 3ac1a60f9eb6..e883fa5eb845 100644 --- a/arch/avr32/kernel/signal.c +++ b/arch/avr32/kernel/signal.c | |||
@@ -22,8 +22,6 @@ | |||
22 | #include <asm/ucontext.h> | 22 | #include <asm/ucontext.h> |
23 | #include <asm/syscalls.h> | 23 | #include <asm/syscalls.h> |
24 | 24 | ||
25 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
26 | |||
27 | asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | 25 | asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, |
28 | struct pt_regs *regs) | 26 | struct pt_regs *regs) |
29 | { | 27 | { |
@@ -89,7 +87,6 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) | |||
89 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 87 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
90 | goto badframe; | 88 | goto badframe; |
91 | 89 | ||
92 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
93 | set_current_blocked(&set); | 90 | set_current_blocked(&set); |
94 | 91 | ||
95 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 92 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c index b20d435d084a..463612643821 100644 --- a/arch/blackfin/kernel/signal.c +++ b/arch/blackfin/kernel/signal.c | |||
@@ -19,8 +19,6 @@ | |||
19 | #include <asm/fixed_code.h> | 19 | #include <asm/fixed_code.h> |
20 | #include <asm/syscall.h> | 20 | #include <asm/syscall.h> |
21 | 21 | ||
22 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
23 | |||
24 | /* Location of the trace bit in SYSCFG. */ | 22 | /* Location of the trace bit in SYSCFG. */ |
25 | #define TRACE_BITS 0x0001 | 23 | #define TRACE_BITS 0x0001 |
26 | 24 | ||
@@ -98,7 +96,6 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused) | |||
98 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 96 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
99 | goto badframe; | 97 | goto badframe; |
100 | 98 | ||
101 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
102 | set_current_blocked(&set); | 99 | set_current_blocked(&set); |
103 | 100 | ||
104 | if (rt_restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) | 101 | if (rt_restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) |
diff --git a/arch/c6x/kernel/signal.c b/arch/c6x/kernel/signal.c index d599a7fb5d24..eb1b3086ae00 100644 --- a/arch/c6x/kernel/signal.c +++ b/arch/c6x/kernel/signal.c | |||
@@ -20,8 +20,6 @@ | |||
20 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
21 | 21 | ||
22 | 22 | ||
23 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
24 | |||
25 | /* | 23 | /* |
26 | * Do a signal return, undo the signal stack. | 24 | * Do a signal return, undo the signal stack. |
27 | */ | 25 | */ |
@@ -87,7 +85,6 @@ asmlinkage int do_rt_sigreturn(struct pt_regs *regs) | |||
87 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 85 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
88 | goto badframe; | 86 | goto badframe; |
89 | 87 | ||
90 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
91 | set_current_blocked(&set); | 88 | set_current_blocked(&set); |
92 | 89 | ||
93 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 90 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c index 46c8ca605e4d..cf6380cb9a57 100644 --- a/arch/cris/arch-v10/kernel/signal.c +++ b/arch/cris/arch-v10/kernel/signal.c | |||
@@ -31,8 +31,6 @@ | |||
31 | 31 | ||
32 | #define DEBUG_SIG 0 | 32 | #define DEBUG_SIG 0 |
33 | 33 | ||
34 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
35 | |||
36 | /* a syscall in Linux/CRIS is a break 13 instruction which is 2 bytes */ | 34 | /* a syscall in Linux/CRIS is a break 13 instruction which is 2 bytes */ |
37 | /* manipulate regs so that upon return, it will be re-executed */ | 35 | /* manipulate regs so that upon return, it will be re-executed */ |
38 | 36 | ||
@@ -176,7 +174,6 @@ asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof, | |||
176 | sizeof(frame->extramask)))) | 174 | sizeof(frame->extramask)))) |
177 | goto badframe; | 175 | goto badframe; |
178 | 176 | ||
179 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
180 | set_current_blocked(&set); | 177 | set_current_blocked(&set); |
181 | 178 | ||
182 | if (restore_sigcontext(regs, &frame->sc)) | 179 | if (restore_sigcontext(regs, &frame->sc)) |
@@ -212,7 +209,6 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13, | |||
212 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 209 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
213 | goto badframe; | 210 | goto badframe; |
214 | 211 | ||
215 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
216 | set_current_blocked(&set); | 212 | set_current_blocked(&set); |
217 | 213 | ||
218 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 214 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c index e0431328b7cd..07b81ee09f65 100644 --- a/arch/cris/arch-v32/kernel/signal.c +++ b/arch/cris/arch-v32/kernel/signal.c | |||
@@ -24,9 +24,6 @@ | |||
24 | 24 | ||
25 | extern unsigned long cris_signal_return_page; | 25 | extern unsigned long cris_signal_return_page; |
26 | 26 | ||
27 | /* Flag to check if a signal is blockable. */ | ||
28 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
29 | |||
30 | /* | 27 | /* |
31 | * A syscall in CRIS is really a "break 13" instruction, which is 2 | 28 | * A syscall in CRIS is really a "break 13" instruction, which is 2 |
32 | * bytes. The registers is manipulated so upon return the instruction | 29 | * bytes. The registers is manipulated so upon return the instruction |
@@ -167,7 +164,6 @@ sys_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp, | |||
167 | sizeof(frame->extramask)))) | 164 | sizeof(frame->extramask)))) |
168 | goto badframe; | 165 | goto badframe; |
169 | 166 | ||
170 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
171 | set_current_blocked(&set); | 167 | set_current_blocked(&set); |
172 | 168 | ||
173 | if (restore_sigcontext(regs, &frame->sc)) | 169 | if (restore_sigcontext(regs, &frame->sc)) |
@@ -208,7 +204,6 @@ sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp, | |||
208 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 204 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
209 | goto badframe; | 205 | goto badframe; |
210 | 206 | ||
211 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
212 | set_current_blocked(&set); | 207 | set_current_blocked(&set); |
213 | 208 | ||
214 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 209 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c index 9ec3d2e27b4c..511285fa2461 100644 --- a/arch/frv/kernel/signal.c +++ b/arch/frv/kernel/signal.c | |||
@@ -28,8 +28,6 @@ | |||
28 | 28 | ||
29 | #define DEBUG_SIG 0 | 29 | #define DEBUG_SIG 0 |
30 | 30 | ||
31 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
32 | |||
33 | struct fdpic_func_descriptor { | 31 | struct fdpic_func_descriptor { |
34 | unsigned long text; | 32 | unsigned long text; |
35 | unsigned long GOT; | 33 | unsigned long GOT; |
@@ -149,7 +147,6 @@ asmlinkage int sys_sigreturn(void) | |||
149 | __copy_from_user(&set.sig[1], &frame->extramask, sizeof(frame->extramask))) | 147 | __copy_from_user(&set.sig[1], &frame->extramask, sizeof(frame->extramask))) |
150 | goto badframe; | 148 | goto badframe; |
151 | 149 | ||
152 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
153 | set_current_blocked(&set); | 150 | set_current_blocked(&set); |
154 | 151 | ||
155 | if (restore_sigcontext(&frame->sc, &gr8)) | 152 | if (restore_sigcontext(&frame->sc, &gr8)) |
@@ -172,7 +169,6 @@ asmlinkage int sys_rt_sigreturn(void) | |||
172 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 169 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
173 | goto badframe; | 170 | goto badframe; |
174 | 171 | ||
175 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
176 | set_current_blocked(&set); | 172 | set_current_blocked(&set); |
177 | 173 | ||
178 | if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8)) | 174 | if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8)) |
diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c index 8fbfc39574f5..aa6f09666915 100644 --- a/arch/h8300/kernel/signal.c +++ b/arch/h8300/kernel/signal.c | |||
@@ -47,8 +47,6 @@ | |||
47 | #include <asm/traps.h> | 47 | #include <asm/traps.h> |
48 | #include <asm/ucontext.h> | 48 | #include <asm/ucontext.h> |
49 | 49 | ||
50 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
51 | |||
52 | /* | 50 | /* |
53 | * Atomically swap in the new signal mask, and wait for a signal. | 51 | * Atomically swap in the new signal mask, and wait for a signal. |
54 | */ | 52 | */ |
@@ -186,7 +184,6 @@ asmlinkage int do_sigreturn(unsigned long __unused,...) | |||
186 | sizeof(frame->extramask)))) | 184 | sizeof(frame->extramask)))) |
187 | goto badframe; | 185 | goto badframe; |
188 | 186 | ||
189 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
190 | set_current_blocked(&set); | 187 | set_current_blocked(&set); |
191 | 188 | ||
192 | if (restore_sigcontext(regs, &frame->sc, &er0)) | 189 | if (restore_sigcontext(regs, &frame->sc, &er0)) |
@@ -211,7 +208,6 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused,...) | |||
211 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 208 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
212 | goto badframe; | 209 | goto badframe; |
213 | 210 | ||
214 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
215 | set_current_blocked(&set); | 211 | set_current_blocked(&set); |
216 | 212 | ||
217 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &er0)) | 213 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &er0)) |
diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c index c9caf7401191..439f11a3a8ef 100644 --- a/arch/hexagon/kernel/signal.c +++ b/arch/hexagon/kernel/signal.c | |||
@@ -31,8 +31,6 @@ | |||
31 | #include <asm/signal.h> | 31 | #include <asm/signal.h> |
32 | #include <asm/vdso.h> | 32 | #include <asm/vdso.h> |
33 | 33 | ||
34 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
35 | |||
36 | struct rt_sigframe { | 34 | struct rt_sigframe { |
37 | unsigned long tramp[2]; | 35 | unsigned long tramp[2]; |
38 | struct siginfo info; | 36 | struct siginfo info; |
@@ -273,7 +271,6 @@ asmlinkage int sys_rt_sigreturn(void) | |||
273 | if (__copy_from_user(&blocked, &frame->uc.uc_sigmask, sizeof(blocked))) | 271 | if (__copy_from_user(&blocked, &frame->uc.uc_sigmask, sizeof(blocked))) |
274 | goto badframe; | 272 | goto badframe; |
275 | 273 | ||
276 | sigdelsetmask(&blocked, ~_BLOCKABLE); | ||
277 | set_current_blocked(&blocked); | 274 | set_current_blocked(&blocked); |
278 | 275 | ||
279 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 276 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c index dc6fe6573465..c4041c76c07d 100644 --- a/arch/ia64/kernel/signal.c +++ b/arch/ia64/kernel/signal.c | |||
@@ -30,7 +30,6 @@ | |||
30 | 30 | ||
31 | #define DEBUG_SIG 0 | 31 | #define DEBUG_SIG 0 |
32 | #define STACK_ALIGN 16 /* minimal alignment for stack pointer */ | 32 | #define STACK_ALIGN 16 /* minimal alignment for stack pointer */ |
33 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
34 | 33 | ||
35 | #if _NSIG_WORDS > 1 | 34 | #if _NSIG_WORDS > 1 |
36 | # define PUT_SIGSET(k,u) __copy_to_user((u)->sig, (k)->sig, sizeof(sigset_t)) | 35 | # define PUT_SIGSET(k,u) __copy_to_user((u)->sig, (k)->sig, sizeof(sigset_t)) |
@@ -200,7 +199,6 @@ ia64_rt_sigreturn (struct sigscratch *scr) | |||
200 | if (GET_SIGSET(&set, &sc->sc_mask)) | 199 | if (GET_SIGSET(&set, &sc->sc_mask)) |
201 | goto give_sigsegv; | 200 | goto give_sigsegv; |
202 | 201 | ||
203 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
204 | set_current_blocked(&set); | 202 | set_current_blocked(&set); |
205 | 203 | ||
206 | if (restore_sigcontext(sc, scr)) | 204 | if (restore_sigcontext(sc, scr)) |
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c index 7cbfa639fbfa..07f9032576c0 100644 --- a/arch/m32r/kernel/signal.c +++ b/arch/m32r/kernel/signal.c | |||
@@ -28,8 +28,6 @@ | |||
28 | 28 | ||
29 | #define DEBUG_SIG 0 | 29 | #define DEBUG_SIG 0 |
30 | 30 | ||
31 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
32 | |||
33 | asmlinkage int | 31 | asmlinkage int |
34 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | 32 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, |
35 | unsigned long r2, unsigned long r3, unsigned long r4, | 33 | unsigned long r2, unsigned long r3, unsigned long r4, |
@@ -111,7 +109,6 @@ sys_rt_sigreturn(unsigned long r0, unsigned long r1, | |||
111 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 109 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
112 | goto badframe; | 110 | goto badframe; |
113 | 111 | ||
114 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
115 | set_current_blocked(&set); | 112 | set_current_blocked(&set); |
116 | 113 | ||
117 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result)) | 114 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result)) |
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index 6dbee8a167a5..c00caad215a6 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c | |||
@@ -51,8 +51,6 @@ | |||
51 | #include <asm/traps.h> | 51 | #include <asm/traps.h> |
52 | #include <asm/ucontext.h> | 52 | #include <asm/ucontext.h> |
53 | 53 | ||
54 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
55 | |||
56 | #ifdef CONFIG_MMU | 54 | #ifdef CONFIG_MMU |
57 | 55 | ||
58 | /* | 56 | /* |
@@ -795,7 +793,6 @@ asmlinkage int do_sigreturn(unsigned long __unused) | |||
795 | sizeof(frame->extramask)))) | 793 | sizeof(frame->extramask)))) |
796 | goto badframe; | 794 | goto badframe; |
797 | 795 | ||
798 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
799 | set_current_blocked(&set); | 796 | set_current_blocked(&set); |
800 | 797 | ||
801 | if (restore_sigcontext(regs, &frame->sc, frame + 1)) | 798 | if (restore_sigcontext(regs, &frame->sc, frame + 1)) |
@@ -820,7 +817,6 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused) | |||
820 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 817 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
821 | goto badframe; | 818 | goto badframe; |
822 | 819 | ||
823 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
824 | set_current_blocked(&set); | 820 | set_current_blocked(&set); |
825 | 821 | ||
826 | if (rt_restore_ucontext(regs, sw, &frame->uc)) | 822 | if (rt_restore_ucontext(regs, sw, &frame->uc)) |
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 03641199666e..c662e68671a2 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c | |||
@@ -41,8 +41,6 @@ | |||
41 | #include <asm/cacheflush.h> | 41 | #include <asm/cacheflush.h> |
42 | #include <asm/syscalls.h> | 42 | #include <asm/syscalls.h> |
43 | 43 | ||
44 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
45 | |||
46 | asmlinkage long | 44 | asmlinkage long |
47 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | 45 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, |
48 | struct pt_regs *regs) | 46 | struct pt_regs *regs) |
@@ -106,7 +104,6 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) | |||
106 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 104 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
107 | goto badframe; | 105 | goto badframe; |
108 | 106 | ||
109 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
110 | set_current_blocked(&set); | 107 | set_current_blocked(&set); |
111 | 108 | ||
112 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &rval)) | 109 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &rval)) |
diff --git a/arch/mips/kernel/signal-common.h b/arch/mips/kernel/signal-common.h index 10263b405981..9c60d09e62a7 100644 --- a/arch/mips/kernel/signal-common.h +++ b/arch/mips/kernel/signal-common.h | |||
@@ -19,8 +19,6 @@ | |||
19 | # define DEBUGP(fmt, args...) | 19 | # define DEBUGP(fmt, args...) |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
23 | |||
24 | /* | 22 | /* |
25 | * Determine which stack to use.. | 23 | * Determine which stack to use.. |
26 | */ | 24 | */ |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 896165757e6f..02e0cba24f82 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -339,7 +339,6 @@ asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
339 | if (__copy_from_user(&blocked, &frame->sf_mask, sizeof(blocked))) | 339 | if (__copy_from_user(&blocked, &frame->sf_mask, sizeof(blocked))) |
340 | goto badframe; | 340 | goto badframe; |
341 | 341 | ||
342 | sigdelsetmask(&blocked, ~_BLOCKABLE); | ||
343 | set_current_blocked(&blocked); | 342 | set_current_blocked(&blocked); |
344 | 343 | ||
345 | sig = restore_sigcontext(®s, &frame->sf_sc); | 344 | sig = restore_sigcontext(®s, &frame->sf_sc); |
@@ -375,7 +374,6 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
375 | if (__copy_from_user(&set, &frame->rs_uc.uc_sigmask, sizeof(set))) | 374 | if (__copy_from_user(&set, &frame->rs_uc.uc_sigmask, sizeof(set))) |
376 | goto badframe; | 375 | goto badframe; |
377 | 376 | ||
378 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
379 | set_current_blocked(&set); | 377 | set_current_blocked(&set); |
380 | 378 | ||
381 | sig = restore_sigcontext(®s, &frame->rs_uc.uc_mcontext); | 379 | sig = restore_sigcontext(®s, &frame->rs_uc.uc_mcontext); |
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index b4fe2eacbd5d..da1b56a39ac7 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
@@ -465,7 +465,6 @@ asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
465 | if (__copy_conv_sigset_from_user(&blocked, &frame->sf_mask)) | 465 | if (__copy_conv_sigset_from_user(&blocked, &frame->sf_mask)) |
466 | goto badframe; | 466 | goto badframe; |
467 | 467 | ||
468 | sigdelsetmask(&blocked, ~_BLOCKABLE); | ||
469 | set_current_blocked(&blocked); | 468 | set_current_blocked(&blocked); |
470 | 469 | ||
471 | sig = restore_sigcontext32(®s, &frame->sf_sc); | 470 | sig = restore_sigcontext32(®s, &frame->sf_sc); |
@@ -503,7 +502,6 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
503 | if (__copy_conv_sigset_from_user(&set, &frame->rs_uc.uc_sigmask)) | 502 | if (__copy_conv_sigset_from_user(&set, &frame->rs_uc.uc_sigmask)) |
504 | goto badframe; | 503 | goto badframe; |
505 | 504 | ||
506 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
507 | set_current_blocked(&set); | 505 | set_current_blocked(&set); |
508 | 506 | ||
509 | sig = restore_sigcontext32(®s, &frame->rs_uc.uc_mcontext); | 507 | sig = restore_sigcontext32(®s, &frame->rs_uc.uc_mcontext); |
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index 63ffac9af7c5..3574c145511b 100644 --- a/arch/mips/kernel/signal_n32.c +++ b/arch/mips/kernel/signal_n32.c | |||
@@ -109,7 +109,6 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
109 | if (__copy_conv_sigset_from_user(&set, &frame->rs_uc.uc_sigmask)) | 109 | if (__copy_conv_sigset_from_user(&set, &frame->rs_uc.uc_sigmask)) |
110 | goto badframe; | 110 | goto badframe; |
111 | 111 | ||
112 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
113 | set_current_blocked(&set); | 112 | set_current_blocked(&set); |
114 | 113 | ||
115 | sig = restore_sigcontext(®s, &frame->rs_uc.uc_mcontext); | 114 | sig = restore_sigcontext(®s, &frame->rs_uc.uc_mcontext); |
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c index d57013e06ea0..4f6d20763061 100644 --- a/arch/mn10300/kernel/signal.c +++ b/arch/mn10300/kernel/signal.c | |||
@@ -31,8 +31,6 @@ | |||
31 | 31 | ||
32 | #define DEBUG_SIG 0 | 32 | #define DEBUG_SIG 0 |
33 | 33 | ||
34 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
35 | |||
36 | /* | 34 | /* |
37 | * atomically swap in the new signal mask, and wait for a signal. | 35 | * atomically swap in the new signal mask, and wait for a signal. |
38 | */ | 36 | */ |
@@ -163,7 +161,6 @@ asmlinkage long sys_sigreturn(void) | |||
163 | sizeof(frame->extramask))) | 161 | sizeof(frame->extramask))) |
164 | goto badframe; | 162 | goto badframe; |
165 | 163 | ||
166 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
167 | set_current_blocked(&set); | 164 | set_current_blocked(&set); |
168 | 165 | ||
169 | if (restore_sigcontext(current_frame(), &frame->sc, &d0)) | 166 | if (restore_sigcontext(current_frame(), &frame->sc, &d0)) |
@@ -191,7 +188,6 @@ asmlinkage long sys_rt_sigreturn(void) | |||
191 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 188 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
192 | goto badframe; | 189 | goto badframe; |
193 | 190 | ||
194 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
195 | set_current_blocked(&set); | 191 | set_current_blocked(&set); |
196 | 192 | ||
197 | if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0)) | 193 | if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0)) |
diff --git a/arch/openrisc/kernel/signal.c b/arch/openrisc/kernel/signal.c index aa1105c1618f..53972b7260b7 100644 --- a/arch/openrisc/kernel/signal.c +++ b/arch/openrisc/kernel/signal.c | |||
@@ -33,8 +33,6 @@ | |||
33 | 33 | ||
34 | #define DEBUG_SIG 0 | 34 | #define DEBUG_SIG 0 |
35 | 35 | ||
36 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
37 | |||
38 | asmlinkage long | 36 | asmlinkage long |
39 | _sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs) | 37 | _sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs) |
40 | { | 38 | { |
@@ -101,7 +99,6 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs) | |||
101 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 99 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
102 | goto badframe; | 100 | goto badframe; |
103 | 101 | ||
104 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
105 | set_current_blocked(&set); | 102 | set_current_blocked(&set); |
106 | 103 | ||
107 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 104 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index 7f3c8f2c962d..25161eaf720d 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c | |||
@@ -48,9 +48,6 @@ | |||
48 | #define DBG(LEVEL, ...) | 48 | #define DBG(LEVEL, ...) |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | |||
52 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
53 | |||
54 | /* gcc will complain if a pointer is cast to an integer of different | 51 | /* gcc will complain if a pointer is cast to an integer of different |
55 | * size. If you really need to do this (and we do for an ELF32 user | 52 | * size. If you really need to do this (and we do for an ELF32 user |
56 | * application in an ELF64 kernel) then you have to do a cast to an | 53 | * application in an ELF64 kernel) then you have to do a cast to an |
@@ -131,7 +128,6 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall) | |||
131 | goto give_sigsegv; | 128 | goto give_sigsegv; |
132 | } | 129 | } |
133 | 130 | ||
134 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
135 | set_current_blocked(&set); | 131 | set_current_blocked(&set); |
136 | 132 | ||
137 | /* Good thing we saved the old gr[30], eh? */ | 133 | /* Good thing we saved the old gr[30], eh? */ |
diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c index e14132430762..fd49aeda9eb8 100644 --- a/arch/parisc/kernel/signal32.c +++ b/arch/parisc/kernel/signal32.c | |||
@@ -47,8 +47,6 @@ | |||
47 | #define DBG(LEVEL, ...) | 47 | #define DBG(LEVEL, ...) |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
51 | |||
52 | inline void | 50 | inline void |
53 | sigset_32to64(sigset_t *s64, compat_sigset_t *s32) | 51 | sigset_32to64(sigset_t *s64, compat_sigset_t *s32) |
54 | { | 52 | { |
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c index d926d2e4611a..3a3413c049c3 100644 --- a/arch/powerpc/kernel/signal.c +++ b/arch/powerpc/kernel/signal.c | |||
@@ -57,7 +57,6 @@ void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, | |||
57 | */ | 57 | */ |
58 | void restore_sigmask(sigset_t *set) | 58 | void restore_sigmask(sigset_t *set) |
59 | { | 59 | { |
60 | sigdelsetmask(set, ~_BLOCKABLE); | ||
61 | set_current_blocked(set); | 60 | set_current_blocked(set); |
62 | } | 61 | } |
63 | 62 | ||
diff --git a/arch/powerpc/kernel/signal.h b/arch/powerpc/kernel/signal.h index 8dde973aaaf5..11439ea18ed4 100644 --- a/arch/powerpc/kernel/signal.h +++ b/arch/powerpc/kernel/signal.h | |||
@@ -10,8 +10,6 @@ | |||
10 | #ifndef _POWERPC_ARCH_SIGNAL_H | 10 | #ifndef _POWERPC_ARCH_SIGNAL_H |
11 | #define _POWERPC_ARCH_SIGNAL_H | 11 | #define _POWERPC_ARCH_SIGNAL_H |
12 | 12 | ||
13 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
14 | |||
15 | extern void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags); | 13 | extern void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags); |
16 | 14 | ||
17 | extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, | 15 | extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, |
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index 233db1d68eee..923baa96c0b0 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
@@ -32,8 +32,6 @@ | |||
32 | #include "compat_ptrace.h" | 32 | #include "compat_ptrace.h" |
33 | #include "entry.h" | 33 | #include "entry.h" |
34 | 34 | ||
35 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
36 | |||
37 | typedef struct | 35 | typedef struct |
38 | { | 36 | { |
39 | __u8 callee_used_stack[__SIGNAL_FRAMESIZE32]; | 37 | __u8 callee_used_stack[__SIGNAL_FRAMESIZE32]; |
@@ -364,7 +362,6 @@ asmlinkage long sys32_sigreturn(void) | |||
364 | goto badframe; | 362 | goto badframe; |
365 | if (__copy_from_user(&set.sig, &frame->sc.oldmask, _SIGMASK_COPY_SIZE32)) | 363 | if (__copy_from_user(&set.sig, &frame->sc.oldmask, _SIGMASK_COPY_SIZE32)) |
366 | goto badframe; | 364 | goto badframe; |
367 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
368 | set_current_blocked(&set); | 365 | set_current_blocked(&set); |
369 | if (restore_sigregs32(regs, &frame->sregs)) | 366 | if (restore_sigregs32(regs, &frame->sregs)) |
370 | goto badframe; | 367 | goto badframe; |
@@ -390,7 +387,6 @@ asmlinkage long sys32_rt_sigreturn(void) | |||
390 | goto badframe; | 387 | goto badframe; |
391 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 388 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
392 | goto badframe; | 389 | goto badframe; |
393 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
394 | set_current_blocked(&set); | 390 | set_current_blocked(&set); |
395 | if (restore_sigregs32(regs, &frame->uc.uc_mcontext)) | 391 | if (restore_sigregs32(regs, &frame->uc.uc_mcontext)) |
396 | goto badframe; | 392 | goto badframe; |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 7f9a862a161a..8332a6943384 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -33,9 +33,6 @@ | |||
33 | #include <asm/switch_to.h> | 33 | #include <asm/switch_to.h> |
34 | #include "entry.h" | 34 | #include "entry.h" |
35 | 35 | ||
36 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
37 | |||
38 | |||
39 | typedef struct | 36 | typedef struct |
40 | { | 37 | { |
41 | __u8 callee_used_stack[__SIGNAL_FRAMESIZE]; | 38 | __u8 callee_used_stack[__SIGNAL_FRAMESIZE]; |
@@ -169,7 +166,6 @@ SYSCALL_DEFINE0(sigreturn) | |||
169 | goto badframe; | 166 | goto badframe; |
170 | if (__copy_from_user(&set.sig, &frame->sc.oldmask, _SIGMASK_COPY_SIZE)) | 167 | if (__copy_from_user(&set.sig, &frame->sc.oldmask, _SIGMASK_COPY_SIZE)) |
171 | goto badframe; | 168 | goto badframe; |
172 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
173 | set_current_blocked(&set); | 169 | set_current_blocked(&set); |
174 | if (restore_sigregs(regs, &frame->sregs)) | 170 | if (restore_sigregs(regs, &frame->sregs)) |
175 | goto badframe; | 171 | goto badframe; |
@@ -189,7 +185,6 @@ SYSCALL_DEFINE0(rt_sigreturn) | |||
189 | goto badframe; | 185 | goto badframe; |
190 | if (__copy_from_user(&set.sig, &frame->uc.uc_sigmask, sizeof(set))) | 186 | if (__copy_from_user(&set.sig, &frame->uc.uc_sigmask, sizeof(set))) |
191 | goto badframe; | 187 | goto badframe; |
192 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
193 | set_current_blocked(&set); | 188 | set_current_blocked(&set); |
194 | if (restore_sigregs(regs, &frame->uc.uc_mcontext)) | 189 | if (restore_sigregs(regs, &frame->uc.uc_mcontext)) |
195 | goto badframe; | 190 | goto badframe; |
diff --git a/arch/score/kernel/signal.c b/arch/score/kernel/signal.c index 13e0eed0e301..f1b3fef0907b 100644 --- a/arch/score/kernel/signal.c +++ b/arch/score/kernel/signal.c | |||
@@ -34,8 +34,6 @@ | |||
34 | #include <asm/syscalls.h> | 34 | #include <asm/syscalls.h> |
35 | #include <asm/ucontext.h> | 35 | #include <asm/ucontext.h> |
36 | 36 | ||
37 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
38 | |||
39 | struct rt_sigframe { | 37 | struct rt_sigframe { |
40 | u32 rs_ass[4]; /* argument save space */ | 38 | u32 rs_ass[4]; /* argument save space */ |
41 | u32 rs_code[2]; /* signal trampoline */ | 39 | u32 rs_code[2]; /* signal trampoline */ |
@@ -162,7 +160,6 @@ score_rt_sigreturn(struct pt_regs *regs) | |||
162 | if (__copy_from_user(&set, &frame->rs_uc.uc_sigmask, sizeof(set))) | 160 | if (__copy_from_user(&set, &frame->rs_uc.uc_sigmask, sizeof(set))) |
163 | goto badframe; | 161 | goto badframe; |
164 | 162 | ||
165 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
166 | set_current_blocked(&set); | 163 | set_current_blocked(&set); |
167 | 164 | ||
168 | sig = restore_sigcontext(regs, &frame->rs_uc.uc_mcontext); | 165 | sig = restore_sigcontext(regs, &frame->rs_uc.uc_mcontext); |
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c index 2675a97f374f..e4a531414e19 100644 --- a/arch/sh/kernel/signal_32.c +++ b/arch/sh/kernel/signal_32.c | |||
@@ -32,8 +32,6 @@ | |||
32 | #include <asm/syscalls.h> | 32 | #include <asm/syscalls.h> |
33 | #include <asm/fpu.h> | 33 | #include <asm/fpu.h> |
34 | 34 | ||
35 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
36 | |||
37 | struct fdpic_func_descriptor { | 35 | struct fdpic_func_descriptor { |
38 | unsigned long text; | 36 | unsigned long text; |
39 | unsigned long GOT; | 37 | unsigned long GOT; |
@@ -226,7 +224,6 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, | |||
226 | sizeof(frame->extramask)))) | 224 | sizeof(frame->extramask)))) |
227 | goto badframe; | 225 | goto badframe; |
228 | 226 | ||
229 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
230 | set_current_blocked(&set); | 227 | set_current_blocked(&set); |
231 | 228 | ||
232 | if (restore_sigcontext(regs, &frame->sc, &r0)) | 229 | if (restore_sigcontext(regs, &frame->sc, &r0)) |
@@ -256,7 +253,6 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, | |||
256 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 253 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
257 | goto badframe; | 254 | goto badframe; |
258 | 255 | ||
259 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
260 | set_current_blocked(&set); | 256 | set_current_blocked(&set); |
261 | 257 | ||
262 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) | 258 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) |
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c index 7075c63bfc6f..75960ef6c1d1 100644 --- a/arch/sh/kernel/signal_64.c +++ b/arch/sh/kernel/signal_64.c | |||
@@ -41,8 +41,6 @@ | |||
41 | 41 | ||
42 | #define DEBUG_SIG 0 | 42 | #define DEBUG_SIG 0 |
43 | 43 | ||
44 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
45 | |||
46 | static void | 44 | static void |
47 | handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | 45 | handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, |
48 | struct pt_regs * regs); | 46 | struct pt_regs * regs); |
@@ -330,7 +328,6 @@ asmlinkage int sys_sigreturn(unsigned long r2, unsigned long r3, | |||
330 | sizeof(frame->extramask)))) | 328 | sizeof(frame->extramask)))) |
331 | goto badframe; | 329 | goto badframe; |
332 | 330 | ||
333 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
334 | set_current_blocked(&set); | 331 | set_current_blocked(&set); |
335 | 332 | ||
336 | if (restore_sigcontext(regs, &frame->sc, &ret)) | 333 | if (restore_sigcontext(regs, &frame->sc, &ret)) |
@@ -363,7 +360,6 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3, | |||
363 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 360 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
364 | goto badframe; | 361 | goto badframe; |
365 | 362 | ||
366 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
367 | set_current_blocked(&set); | 363 | set_current_blocked(&set); |
368 | 364 | ||
369 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ret)) | 365 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ret)) |
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index 8c93c00922a7..ba3dbfcdb28e 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c | |||
@@ -32,8 +32,6 @@ | |||
32 | 32 | ||
33 | #include "sigutil.h" | 33 | #include "sigutil.h" |
34 | 34 | ||
35 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
36 | |||
37 | /* This magic should be in g_upper[0] for all upper parts | 35 | /* This magic should be in g_upper[0] for all upper parts |
38 | * to be valid. | 36 | * to be valid. |
39 | */ | 37 | */ |
@@ -274,7 +272,6 @@ void do_sigreturn32(struct pt_regs *regs) | |||
274 | case 2: set.sig[1] = seta[2] + (((long)seta[3]) << 32); | 272 | case 2: set.sig[1] = seta[2] + (((long)seta[3]) << 32); |
275 | case 1: set.sig[0] = seta[0] + (((long)seta[1]) << 32); | 273 | case 1: set.sig[0] = seta[0] + (((long)seta[1]) << 32); |
276 | } | 274 | } |
277 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
278 | set_current_blocked(&set); | 275 | set_current_blocked(&set); |
279 | return; | 276 | return; |
280 | 277 | ||
@@ -376,7 +373,6 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) | |||
376 | case 2: set.sig[1] = seta.sig[2] + (((long)seta.sig[3]) << 32); | 373 | case 2: set.sig[1] = seta.sig[2] + (((long)seta.sig[3]) << 32); |
377 | case 1: set.sig[0] = seta.sig[0] + (((long)seta.sig[1]) << 32); | 374 | case 1: set.sig[0] = seta.sig[0] + (((long)seta.sig[1]) << 32); |
378 | } | 375 | } |
379 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
380 | set_current_blocked(&set); | 376 | set_current_blocked(&set); |
381 | return; | 377 | return; |
382 | segv: | 378 | segv: |
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index f6722427203d..1bfa854be602 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -29,8 +29,6 @@ | |||
29 | 29 | ||
30 | #include "sigutil.h" | 30 | #include "sigutil.h" |
31 | 31 | ||
32 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
33 | |||
34 | extern void fpsave(unsigned long *fpregs, unsigned long *fsr, | 32 | extern void fpsave(unsigned long *fpregs, unsigned long *fsr, |
35 | void *fpqueue, unsigned long *fpqdepth); | 33 | void *fpqueue, unsigned long *fpqdepth); |
36 | extern void fpload(unsigned long *fpregs, unsigned long *fsr); | 34 | extern void fpload(unsigned long *fpregs, unsigned long *fsr); |
@@ -130,7 +128,6 @@ asmlinkage void do_sigreturn(struct pt_regs *regs) | |||
130 | if (err) | 128 | if (err) |
131 | goto segv_and_exit; | 129 | goto segv_and_exit; |
132 | 130 | ||
133 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
134 | set_current_blocked(&set); | 131 | set_current_blocked(&set); |
135 | return; | 132 | return; |
136 | 133 | ||
@@ -197,7 +194,6 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs) | |||
197 | goto segv; | 194 | goto segv; |
198 | } | 195 | } |
199 | 196 | ||
200 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
201 | set_current_blocked(&set); | 197 | set_current_blocked(&set); |
202 | return; | 198 | return; |
203 | segv: | 199 | segv: |
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index febbc4b697ba..23b60caa6c43 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
@@ -38,8 +38,6 @@ | |||
38 | #include "systbls.h" | 38 | #include "systbls.h" |
39 | #include "sigutil.h" | 39 | #include "sigutil.h" |
40 | 40 | ||
41 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
42 | |||
43 | /* {set, get}context() needed for 64-bit SparcLinux userland. */ | 41 | /* {set, get}context() needed for 64-bit SparcLinux userland. */ |
44 | asmlinkage void sparc64_set_context(struct pt_regs *regs) | 42 | asmlinkage void sparc64_set_context(struct pt_regs *regs) |
45 | { | 43 | { |
@@ -71,7 +69,6 @@ asmlinkage void sparc64_set_context(struct pt_regs *regs) | |||
71 | if (__copy_from_user(&set, &ucp->uc_sigmask, sizeof(sigset_t))) | 69 | if (__copy_from_user(&set, &ucp->uc_sigmask, sizeof(sigset_t))) |
72 | goto do_sigsegv; | 70 | goto do_sigsegv; |
73 | } | 71 | } |
74 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
75 | set_current_blocked(&set); | 72 | set_current_blocked(&set); |
76 | } | 73 | } |
77 | if (test_thread_flag(TIF_32BIT)) { | 74 | if (test_thread_flag(TIF_32BIT)) { |
@@ -315,7 +312,6 @@ void do_rt_sigreturn(struct pt_regs *regs) | |||
315 | /* Prevent syscall restart. */ | 312 | /* Prevent syscall restart. */ |
316 | pt_regs_clear_syscall(regs); | 313 | pt_regs_clear_syscall(regs); |
317 | 314 | ||
318 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
319 | set_current_blocked(&set); | 315 | set_current_blocked(&set); |
320 | return; | 316 | return; |
321 | segv: | 317 | segv: |
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c index cdef6e5ec022..474571b84085 100644 --- a/arch/tile/kernel/compat_signal.c +++ b/arch/tile/kernel/compat_signal.c | |||
@@ -118,8 +118,6 @@ struct compat_rt_sigframe { | |||
118 | struct compat_ucontext uc; | 118 | struct compat_ucontext uc; |
119 | }; | 119 | }; |
120 | 120 | ||
121 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
122 | |||
123 | long compat_sys_rt_sigaction(int sig, struct compat_sigaction __user *act, | 121 | long compat_sys_rt_sigaction(int sig, struct compat_sigaction __user *act, |
124 | struct compat_sigaction __user *oact, | 122 | struct compat_sigaction __user *oact, |
125 | size_t sigsetsize) | 123 | size_t sigsetsize) |
@@ -302,7 +300,6 @@ long compat_sys_rt_sigreturn(struct pt_regs *regs) | |||
302 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 300 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
303 | goto badframe; | 301 | goto badframe; |
304 | 302 | ||
305 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
306 | set_current_blocked(&set); | 303 | set_current_blocked(&set); |
307 | 304 | ||
308 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 305 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
diff --git a/arch/tile/kernel/signal.c b/arch/tile/kernel/signal.c index 9b71bfd4913d..e068aa0c6dfc 100644 --- a/arch/tile/kernel/signal.c +++ b/arch/tile/kernel/signal.c | |||
@@ -37,8 +37,6 @@ | |||
37 | 37 | ||
38 | #define DEBUG_SIG 0 | 38 | #define DEBUG_SIG 0 |
39 | 39 | ||
40 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
41 | |||
42 | SYSCALL_DEFINE3(sigaltstack, const stack_t __user *, uss, | 40 | SYSCALL_DEFINE3(sigaltstack, const stack_t __user *, uss, |
43 | stack_t __user *, uoss, struct pt_regs *, regs) | 41 | stack_t __user *, uoss, struct pt_regs *, regs) |
44 | { | 42 | { |
@@ -96,7 +94,6 @@ SYSCALL_DEFINE1(rt_sigreturn, struct pt_regs *, regs) | |||
96 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 94 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
97 | goto badframe; | 95 | goto badframe; |
98 | 96 | ||
99 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
100 | set_current_blocked(&set); | 97 | set_current_blocked(&set); |
101 | 98 | ||
102 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 99 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
diff --git a/arch/um/include/shared/frame_kern.h b/arch/um/include/shared/frame_kern.h index 76078490c258..e584e40ee832 100644 --- a/arch/um/include/shared/frame_kern.h +++ b/arch/um/include/shared/frame_kern.h | |||
@@ -6,9 +6,6 @@ | |||
6 | #ifndef __FRAME_KERN_H_ | 6 | #ifndef __FRAME_KERN_H_ |
7 | #define __FRAME_KERN_H_ | 7 | #define __FRAME_KERN_H_ |
8 | 8 | ||
9 | #define _S(nr) (1<<((nr)-1)) | ||
10 | #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP))) | ||
11 | |||
12 | extern int setup_signal_stack_sc(unsigned long stack_top, int sig, | 9 | extern int setup_signal_stack_sc(unsigned long stack_top, int sig, |
13 | struct k_sigaction *ka, | 10 | struct k_sigaction *ka, |
14 | struct pt_regs *regs, | 11 | struct pt_regs *regs, |
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c index 549a51c8e54f..4ce6ab2d2996 100644 --- a/arch/um/kernel/signal.c +++ b/arch/um/kernel/signal.c | |||
@@ -15,10 +15,6 @@ | |||
15 | EXPORT_SYMBOL(block_signals); | 15 | EXPORT_SYMBOL(block_signals); |
16 | EXPORT_SYMBOL(unblock_signals); | 16 | EXPORT_SYMBOL(unblock_signals); |
17 | 17 | ||
18 | #define _S(nr) (1<<((nr)-1)) | ||
19 | |||
20 | #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP))) | ||
21 | |||
22 | /* | 18 | /* |
23 | * OK, we're invoking a handler | 19 | * OK, we're invoking a handler |
24 | */ | 20 | */ |
diff --git a/arch/unicore32/kernel/signal.c b/arch/unicore32/kernel/signal.c index af962e57efb2..4d9c4841989d 100644 --- a/arch/unicore32/kernel/signal.c +++ b/arch/unicore32/kernel/signal.c | |||
@@ -21,8 +21,6 @@ | |||
21 | #include <asm/cacheflush.h> | 21 | #include <asm/cacheflush.h> |
22 | #include <asm/ucontext.h> | 22 | #include <asm/ucontext.h> |
23 | 23 | ||
24 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
25 | |||
26 | /* | 24 | /* |
27 | * For UniCore syscalls, we encode the syscall number into the instruction. | 25 | * For UniCore syscalls, we encode the syscall number into the instruction. |
28 | */ | 26 | */ |
@@ -61,10 +59,8 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf) | |||
61 | int err; | 59 | int err; |
62 | 60 | ||
63 | err = __copy_from_user(&set, &sf->uc.uc_sigmask, sizeof(set)); | 61 | err = __copy_from_user(&set, &sf->uc.uc_sigmask, sizeof(set)); |
64 | if (err == 0) { | 62 | if (err == 0) |
65 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
66 | set_current_blocked(&set); | 63 | set_current_blocked(&set); |
67 | } | ||
68 | 64 | ||
69 | err |= __get_user(regs->UCreg_00, &sf->uc.uc_mcontext.regs.UCreg_00); | 65 | err |= __get_user(regs->UCreg_00, &sf->uc.uc_mcontext.regs.UCreg_00); |
70 | err |= __get_user(regs->UCreg_01, &sf->uc.uc_mcontext.regs.UCreg_01); | 66 | err |= __get_user(regs->UCreg_01, &sf->uc.uc_mcontext.regs.UCreg_01); |
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index 98bd70faccc5..daeca56211e3 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c | |||
@@ -273,7 +273,6 @@ asmlinkage long sys32_sigreturn(struct pt_regs *regs) | |||
273 | sizeof(frame->extramask)))) | 273 | sizeof(frame->extramask)))) |
274 | goto badframe; | 274 | goto badframe; |
275 | 275 | ||
276 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
277 | set_current_blocked(&set); | 276 | set_current_blocked(&set); |
278 | 277 | ||
279 | if (ia32_restore_sigcontext(regs, &frame->sc, &ax)) | 278 | if (ia32_restore_sigcontext(regs, &frame->sc, &ax)) |
@@ -299,7 +298,6 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs) | |||
299 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 298 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
300 | goto badframe; | 299 | goto badframe; |
301 | 300 | ||
302 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
303 | set_current_blocked(&set); | 301 | set_current_blocked(&set); |
304 | 302 | ||
305 | if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) | 303 | if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) |
diff --git a/arch/x86/include/asm/sighandling.h b/arch/x86/include/asm/sighandling.h index ada93b3b8c66..beff97f7df37 100644 --- a/arch/x86/include/asm/sighandling.h +++ b/arch/x86/include/asm/sighandling.h | |||
@@ -7,8 +7,6 @@ | |||
7 | 7 | ||
8 | #include <asm/processor-flags.h> | 8 | #include <asm/processor-flags.h> |
9 | 9 | ||
10 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
11 | |||
12 | #define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \ | 10 | #define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \ |
13 | X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \ | 11 | X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \ |
14 | X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \ | 12 | X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \ |
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 700c49dcd84e..11e206f0f45a 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -555,7 +555,6 @@ unsigned long sys_sigreturn(struct pt_regs *regs) | |||
555 | sizeof(frame->extramask)))) | 555 | sizeof(frame->extramask)))) |
556 | goto badframe; | 556 | goto badframe; |
557 | 557 | ||
558 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
559 | set_current_blocked(&set); | 558 | set_current_blocked(&set); |
560 | 559 | ||
561 | if (restore_sigcontext(regs, &frame->sc, &ax)) | 560 | if (restore_sigcontext(regs, &frame->sc, &ax)) |
@@ -581,7 +580,6 @@ long sys_rt_sigreturn(struct pt_regs *regs) | |||
581 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 580 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
582 | goto badframe; | 581 | goto badframe; |
583 | 582 | ||
584 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
585 | set_current_blocked(&set); | 583 | set_current_blocked(&set); |
586 | 584 | ||
587 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) | 585 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) |
@@ -915,7 +913,6 @@ asmlinkage long sys32_x32_rt_sigreturn(struct pt_regs *regs) | |||
915 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 913 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
916 | goto badframe; | 914 | goto badframe; |
917 | 915 | ||
918 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
919 | set_current_blocked(&set); | 916 | set_current_blocked(&set); |
920 | 917 | ||
921 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) | 918 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) |
diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c index bb0fb03b9f85..a508cea13503 100644 --- a/arch/x86/um/signal.c +++ b/arch/x86/um/signal.c | |||
@@ -486,7 +486,6 @@ long sys_sigreturn(struct pt_regs *regs) | |||
486 | copy_from_user(&set.sig[1], extramask, sig_size)) | 486 | copy_from_user(&set.sig[1], extramask, sig_size)) |
487 | goto segfault; | 487 | goto segfault; |
488 | 488 | ||
489 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
490 | set_current_blocked(&set); | 489 | set_current_blocked(&set); |
491 | 490 | ||
492 | if (copy_sc_from_user(¤t->thread.regs, sc)) | 491 | if (copy_sc_from_user(¤t->thread.regs, sc)) |
@@ -600,7 +599,6 @@ long sys_rt_sigreturn(struct pt_regs *regs) | |||
600 | if (copy_from_user(&set, &uc->uc_sigmask, sizeof(set))) | 599 | if (copy_from_user(&set, &uc->uc_sigmask, sizeof(set))) |
601 | goto segfault; | 600 | goto segfault; |
602 | 601 | ||
603 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
604 | set_current_blocked(&set); | 602 | set_current_blocked(&set); |
605 | 603 | ||
606 | if (copy_sc_from_user(¤t->thread.regs, &uc->uc_mcontext)) | 604 | if (copy_sc_from_user(¤t->thread.regs, &uc->uc_mcontext)) |
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c index ca98b86ef9a7..4da3c6f6d929 100644 --- a/arch/xtensa/kernel/signal.c +++ b/arch/xtensa/kernel/signal.c | |||
@@ -30,8 +30,6 @@ | |||
30 | 30 | ||
31 | #define DEBUG_SIG 0 | 31 | #define DEBUG_SIG 0 |
32 | 32 | ||
33 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
34 | |||
35 | extern struct task_struct *coproc_owners[]; | 33 | extern struct task_struct *coproc_owners[]; |
36 | 34 | ||
37 | struct rt_sigframe | 35 | struct rt_sigframe |
@@ -261,7 +259,6 @@ asmlinkage long xtensa_rt_sigreturn(long a0, long a1, long a2, long a3, | |||
261 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 259 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
262 | goto badframe; | 260 | goto badframe; |
263 | 261 | ||
264 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
265 | set_current_blocked(&set); | 262 | set_current_blocked(&set); |
266 | 263 | ||
267 | if (restore_sigcontext(regs, frame)) | 264 | if (restore_sigcontext(regs, frame)) |