aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/goldfish/patches-2.6.30/0060--ARM-Add-code-to-prevent-system-calls-from-being-re.patch
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-05 10:12:53 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-05 10:12:53 +0000
commit5c105d9f3fd086aff195d3849dcf847d6b0bd927 (patch)
tree1229a11f725bfa58aa7c57a76898553bb5f6654a /target/linux/goldfish/patches-2.6.30/0060--ARM-Add-code-to-prevent-system-calls-from-being-re.patch
downloadopenwrt-5c105d9f3fd086aff195d3849dcf847d6b0bd927.tar.gz
openwrt-5c105d9f3fd086aff195d3849dcf847d6b0bd927.zip
branch Attitude Adjustment
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@33625 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/goldfish/patches-2.6.30/0060--ARM-Add-code-to-prevent-system-calls-from-being-re.patch')
-rw-r--r--target/linux/goldfish/patches-2.6.30/0060--ARM-Add-code-to-prevent-system-calls-from-being-re.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/goldfish/patches-2.6.30/0060--ARM-Add-code-to-prevent-system-calls-from-being-re.patch b/target/linux/goldfish/patches-2.6.30/0060--ARM-Add-code-to-prevent-system-calls-from-being-re.patch
new file mode 100644
index 000000000..896661615
--- /dev/null
+++ b/target/linux/goldfish/patches-2.6.30/0060--ARM-Add-code-to-prevent-system-calls-from-being-re.patch
@@ -0,0 +1,35 @@
+From d52bcb0a807dde87057f330dbe95aa6d221a4b85 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
+Date: Mon, 9 Apr 2007 17:13:02 +0700
+Subject: [PATCH 060/134] [ARM] Add code to prevent system calls from being restarted muliple times before returning from the kernel.
+
+Fixes crashes with thumb syscalls.
+---
+ arch/arm/kernel/signal.c | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+--- a/arch/arm/kernel/signal.c
++++ b/arch/arm/kernel/signal.c
+@@ -499,6 +499,14 @@ setup_rt_frame(int usig, struct k_sigact
+
+ static inline void restart_syscall(struct pt_regs *regs)
+ {
++ if (regs->ARM_ORIG_r0 == -ERESTARTNOHAND ||
++ regs->ARM_ORIG_r0 == -ERESTARTSYS ||
++ regs->ARM_ORIG_r0 == -ERESTARTNOINTR ||
++ regs->ARM_ORIG_r0 == -ERESTART_RESTARTBLOCK) {
++ /* the syscall cannot be safely restarted, return -EINTR instead */
++ regs->ARM_r0 = -EINTR;
++ return;
++ }
+ regs->ARM_r0 = regs->ARM_ORIG_r0;
+ regs->ARM_pc -= thumb_mode(regs) ? 2 : 4;
+ }
+@@ -631,6 +639,7 @@ static void do_signal(struct pt_regs *re
+ */
+ if (syscall) {
+ if (regs->ARM_r0 == -ERESTART_RESTARTBLOCK) {
++ regs->ARM_r0 = -EAGAIN; /* prevent multiple restarts */
+ if (thumb_mode(regs)) {
+ regs->ARM_r7 = __NR_restart_syscall - __NR_SYSCALL_BASE;
+ regs->ARM_pc -= 2;