diff options
author | Jean PIHET <jpihet@mvista.com> | 2009-11-23 11:03:32 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-11-23 12:28:23 -0500 |
commit | 3336f4f08e0dad7a2b6493c80b49b685141d53ad (patch) | |
tree | 803eba990a210afc012f92c3ace18ec9ad43cc80 /arch | |
parent | cefbf4ea629427af2fb4709bab9fe126dcddc234 (diff) |
ARM: 5793/1: ARM: Check put_user fail in do_signal when enable OABI_COMPAT
Using OABI, the call to put_user in do_signal can fail causing the
calling app to hang.
The solution is to check if put_user fails and force the app to
seg fault in that case.
Tested with multiple sleeping apps/threads (using the nanosleep syscall)
and suspend/resume.
Signed-off-by: janboe <janboe.ye at gmail.com>
Signed-off-by: Jean Pihet <jpihet@mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/signal.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 2a573d4fea24..e7714f367eb8 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -662,8 +662,12 @@ static void do_signal(struct pt_regs *regs, int syscall) | |||
662 | regs->ARM_sp -= 4; | 662 | regs->ARM_sp -= 4; |
663 | usp = (u32 __user *)regs->ARM_sp; | 663 | usp = (u32 __user *)regs->ARM_sp; |
664 | 664 | ||
665 | put_user(regs->ARM_pc, usp); | 665 | if (put_user(regs->ARM_pc, usp) == 0) { |
666 | regs->ARM_pc = KERN_RESTART_CODE; | 666 | regs->ARM_pc = KERN_RESTART_CODE; |
667 | } else { | ||
668 | regs->ARM_sp += 4; | ||
669 | force_sigsegv(0, current); | ||
670 | } | ||
667 | #endif | 671 | #endif |
668 | } | 672 | } |
669 | } | 673 | } |