diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-02-12 19:05:11 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-02-13 17:40:51 -0500 |
commit | 431dc8040354db65e4f8d4d4e21ae4fab41f5bc3 (patch) | |
tree | 54381eb2e9b738fd3d87fd129da85086983296c5 /arch/mips/kernel/signal32.c | |
parent | 366d6aef281a670b32a51d289fc07bf0e5e72d9a (diff) |
[MIPS] Fix sigset_t endianess swapping issues in 32-bit compat code.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/signal32.c')
-rw-r--r-- | arch/mips/kernel/signal32.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index db00c333bff3..c28cb21514c8 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | 8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. |
9 | */ | 9 | */ |
10 | #include <linux/cache.h> | 10 | #include <linux/cache.h> |
11 | #include <linux/compat.h> | ||
11 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
12 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
13 | #include <linux/smp.h> | 14 | #include <linux/smp.h> |
@@ -24,6 +25,7 @@ | |||
24 | 25 | ||
25 | #include <asm/abi.h> | 26 | #include <asm/abi.h> |
26 | #include <asm/asm.h> | 27 | #include <asm/asm.h> |
28 | #include <asm/compat-signal.h> | ||
27 | #include <linux/bitops.h> | 29 | #include <linux/bitops.h> |
28 | #include <asm/cacheflush.h> | 30 | #include <asm/cacheflush.h> |
29 | #include <asm/sim.h> | 31 | #include <asm/sim.h> |
@@ -517,7 +519,7 @@ asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
517 | frame = (struct sigframe32 __user *) regs.regs[29]; | 519 | frame = (struct sigframe32 __user *) regs.regs[29]; |
518 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 520 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
519 | goto badframe; | 521 | goto badframe; |
520 | if (__copy_from_user(&blocked, &frame->sf_mask, sizeof(blocked))) | 522 | if (__copy_conv_sigset_from_user(&blocked, &frame->sf_mask)) |
521 | goto badframe; | 523 | goto badframe; |
522 | 524 | ||
523 | sigdelsetmask(&blocked, ~_BLOCKABLE); | 525 | sigdelsetmask(&blocked, ~_BLOCKABLE); |
@@ -554,7 +556,7 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
554 | frame = (struct rt_sigframe32 __user *) regs.regs[29]; | 556 | frame = (struct rt_sigframe32 __user *) regs.regs[29]; |
555 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 557 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
556 | goto badframe; | 558 | goto badframe; |
557 | if (__copy_from_user(&set, &frame->rs_uc.uc_sigmask, sizeof(set))) | 559 | if (__copy_conv_sigset_from_user(&set, &frame->rs_uc.uc_sigmask)) |
558 | goto badframe; | 560 | goto badframe; |
559 | 561 | ||
560 | sigdelsetmask(&set, ~_BLOCKABLE); | 562 | sigdelsetmask(&set, ~_BLOCKABLE); |
@@ -609,7 +611,8 @@ int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs, | |||
609 | err |= install_sigtramp(frame->sf_code, __NR_O32_sigreturn); | 611 | err |= install_sigtramp(frame->sf_code, __NR_O32_sigreturn); |
610 | 612 | ||
611 | err |= setup_sigcontext32(regs, &frame->sf_sc); | 613 | err |= setup_sigcontext32(regs, &frame->sf_sc); |
612 | err |= __copy_to_user(&frame->sf_mask, set, sizeof(*set)); | 614 | err |= __copy_conv_sigset_to_user(&frame->sf_mask, set); |
615 | |||
613 | if (err) | 616 | if (err) |
614 | goto give_sigsegv; | 617 | goto give_sigsegv; |
615 | 618 | ||
@@ -668,7 +671,7 @@ int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, | |||
668 | err |= __put_user(current->sas_ss_size, | 671 | err |= __put_user(current->sas_ss_size, |
669 | &frame->rs_uc.uc_stack.ss_size); | 672 | &frame->rs_uc.uc_stack.ss_size); |
670 | err |= setup_sigcontext32(regs, &frame->rs_uc.uc_mcontext); | 673 | err |= setup_sigcontext32(regs, &frame->rs_uc.uc_mcontext); |
671 | err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); | 674 | err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set); |
672 | 675 | ||
673 | if (err) | 676 | if (err) |
674 | goto give_sigsegv; | 677 | goto give_sigsegv; |