Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3336f4f0 authored by Jean PIHET's avatar Jean PIHET Committed by Russell King
Browse files

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: default avatarJean Pihet <jpihet@mvista.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent cefbf4ea
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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);
				if (put_user(regs->ARM_pc, usp) == 0) {
					regs->ARM_pc = KERN_RESTART_CODE;
				} else {
					regs->ARM_sp += 4;
					force_sigsegv(0, current);
				}
#endif
			}
		}