From: Jean PIHET Date: Mon, 23 Nov 2009 16:03:32 +0000 (+0100) Subject: ARM: 5793/1: ARM: Check put_user fail in do_signal when enable OABI_COMPAT X-Git-Tag: firefly_0821_release~11827^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3336f4f08e0dad7a2b6493c80b49b685141d53ad;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Jean Pihet Signed-off-by: Russell King --- 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) regs->ARM_sp -= 4; usp = (u32 __user *)regs->ARM_sp; - put_user(regs->ARM_pc, usp); - regs->ARM_pc = KERN_RESTART_CODE; + if (put_user(regs->ARM_pc, usp) == 0) { + regs->ARM_pc = KERN_RESTART_CODE; + } else { + regs->ARM_sp += 4; + force_sigsegv(0, current); + } #endif } }