aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/signal_32.c13
-rw-r--r--arch/x86/kernel/signal_64.c13
2 files changed, 18 insertions, 8 deletions
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index b1bc90f19b9a..cf62f70cc2a6 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -491,6 +491,8 @@ static int signr_convert(int sig)
491 return sig; 491 return sig;
492} 492}
493 493
494#define is_ia32 1
495
494static int 496static int
495setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 497setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
496 sigset_t *set, struct pt_regs *regs) 498 sigset_t *set, struct pt_regs *regs)
@@ -499,10 +501,13 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
499 int ret; 501 int ret;
500 502
501 /* Set up the stack frame */ 503 /* Set up the stack frame */
502 if (ka->sa.sa_flags & SA_SIGINFO) 504 if (is_ia32) {
503 ret = __setup_rt_frame(usig, ka, info, set, regs); 505 if (ka->sa.sa_flags & SA_SIGINFO)
504 else 506 ret = __setup_rt_frame(usig, ka, info, set, regs);
505 ret = __setup_frame(usig, ka, set, regs); 507 else
508 ret = __setup_frame(usig, ka, set, regs);
509 } else
510 ret = __setup_rt_frame(sig, ka, info, set, regs);
506 511
507 if (ret) { 512 if (ret) {
508 force_sigsegv(sig, current); 513 force_sigsegv(sig, current);
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index c5d80024a8f3..53f86d95985b 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -286,6 +286,12 @@ static int signr_convert(int sig)
286 return sig; 286 return sig;
287} 287}
288 288
289#ifdef CONFIG_IA32_EMULATION
290#define is_ia32 test_thread_flag(TIF_IA32)
291#else
292#define is_ia32 0
293#endif
294
289static int 295static int
290setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 296setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
291 sigset_t *set, struct pt_regs *regs) 297 sigset_t *set, struct pt_regs *regs)
@@ -293,15 +299,14 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
293 int usig = signr_convert(sig); 299 int usig = signr_convert(sig);
294 int ret; 300 int ret;
295 301
296#ifdef CONFIG_IA32_EMULATION 302 /* Set up the stack frame */
297 if (test_thread_flag(TIF_IA32)) { 303 if (is_ia32) {
298 if (ka->sa.sa_flags & SA_SIGINFO) 304 if (ka->sa.sa_flags & SA_SIGINFO)
299 ret = ia32_setup_rt_frame(usig, ka, info, set, regs); 305 ret = ia32_setup_rt_frame(usig, ka, info, set, regs);
300 else 306 else
301 ret = ia32_setup_frame(usig, ka, set, regs); 307 ret = ia32_setup_frame(usig, ka, set, regs);
302 } else 308 } else
303#endif 309 ret = __setup_rt_frame(sig, ka, info, set, regs);
304 ret = __setup_rt_frame(sig, ka, info, set, regs);
305 310
306 if (ret) { 311 if (ret) {
307 force_sigsegv(sig, current); 312 force_sigsegv(sig, current);