Cherry-pick utrace-ptrace fixes from mayoung. Thanks!

This commit is contained in:
Kyle McMartin 2010-11-08 10:38:33 -05:00
parent 7b2f649ec2
commit 1aea2328b4
3 changed files with 23 additions and 18 deletions

View File

@ -3116,7 +3116,6 @@ CONFIG_USB_SE401=m
CONFIG_USB_ZR364XX=m
CONFIG_SOC_CAMERA=m
CONFIG_SOC_CAMERA_MT9M001=m
CONFIG_SOC_CAMERA_MT9M001=m
CONFIG_SOC_CAMERA_MT9V022=m
CONFIG_SOC_CAMERA_PLATFORM=m
CONFIG_SOC_CAMERA_MT9M111=m

View File

@ -1122,7 +1122,7 @@ ApplyPatch linux-2.6-hotfixes.patch
# Roland's utrace ptrace replacement.
ApplyPatch linux-2.6-tracehook.patch
ApplyPatch linux-2.6-utrace.patch
#ApplyPatch linux-2.6-utrace-ptrace.patch
ApplyPatch linux-2.6-utrace-ptrace.patch
# Architecture patches
# x86(-64)
@ -1900,6 +1900,9 @@ fi
# || ||
%changelog
* Mon Nov 08 2010 Kyle McMartin <kyle@redhat.com>
- Cherry-pick utrace-ptrace fixes from mayoung. Thanks!
* Tue Nov 02 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.1.rc1.git0
- Linux 2.6.37-rc1

View File

@ -29,9 +29,9 @@ index a85fb41..235c1b0 100644
-
+extern void ptrace_notify_stop(struct task_struct *tracee);
extern long arch_ptrace(struct task_struct *child, long request, long addr, long data);
extern long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data);
extern int ptrace_traceme(void);
extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
diff --git a/kernel/Makefile b/kernel/Makefile
index 6004913..b09c9a5 100644
--- a/kernel/Makefile
@ -673,7 +673,7 @@ index ...a90078d 100644
+ * under ptrace.
+ */
+ retval = -ERESTARTNOINTR;
+ if (mutex_lock_interruptible(&task->cred_guard_mutex))
+ if (mutex_lock_interruptible(&task->signal->cred_guard_mutex))
+ goto out;
+
+ task_lock(task);
@ -703,7 +703,7 @@ index ...a90078d 100644
+unlock_tasklist:
+ write_unlock_irq(&tasklist_lock);
+unlock_creds:
+ mutex_unlock(&task->cred_guard_mutex);
+ mutex_unlock(&task->signal->cred_guard_mutex);
+out:
+ return retval;
+}
@ -1014,7 +1014,7 @@ index ...a90078d 100644
+ struct iovec *kiov);
+
+int ptrace_request(struct task_struct *child, long request,
+ long addr, long data)
+ unsigned long addr, unsigned long data)
+{
+ struct utrace_engine *engine = ptrace_lookup_engine(child);
+ siginfo_t siginfo;
@ -1412,7 +1412,7 @@ index 23bde94..daed9e8 100644
+#define arch_ptrace_attach(child) do { } while (0)
+#endif
+
+SYSCALL_DEFINE4(ptrace, long, request, long, pid, long, addr, long, data)
+SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr, unsigned long, data)
+{
+ struct task_struct *child;
+ long ret;
@ -1453,7 +1453,7 @@ index 23bde94..daed9e8 100644
+ return ret;
+}
+
+int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data)
+int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr, unsigned long data)
+{
+ unsigned long tmp;
+ int copied;
@ -1464,7 +1464,7 @@ index 23bde94..daed9e8 100644
+ return put_user(tmp, (unsigned long __user *)data);
+}
+
+int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data)
+int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, unsigned long data)
+{
+ int copied;
+
@ -1595,7 +1595,7 @@ index 23bde94..daed9e8 100644
unlock_tasklist:
- write_unlock_irq(&tasklist_lock);
-unlock_creds:
- mutex_unlock(&task->cred_guard_mutex);
- mutex_unlock(&task->signal->cred_guard_mutex);
-out:
- return retval;
-}
@ -1656,7 +1656,7 @@ index 23bde94..daed9e8 100644
- * If it should reap itself, return true.
+ write_unlock_irq(&tasklist_lock);
+unlock_creds:
+ mutex_unlock(&task->cred_guard_mutex);
+ mutex_unlock(&task->signal->cred_guard_mutex);
+out:
+ return retval;
+}
@ -1765,7 +1765,7 @@ index 23bde94..daed9e8 100644
- return copied;
-}
-
static int ptrace_setoptions(struct task_struct *child, long data)
static int ptrace_setoptions(struct task_struct *child, unsigned long data)
{
child->ptrace &= ~PT_TRACE_MASK;
@@ -530,47 +677,6 @@ static int ptrace_resume(struct task_str
@ -1814,9 +1814,9 @@ index 23bde94..daed9e8 100644
-#endif
-
int ptrace_request(struct task_struct *child, long request,
long addr, long data)
unsigned long addr, unsigned long data)
{
@@ -686,88 +792,7 @@ int ptrace_request(struct task_struct *c
@@ -686,91 +792,7 @@ int ptrace_request(struct task_struct *c
return ret;
}
@ -1839,7 +1839,8 @@ index 23bde94..daed9e8 100644
-#define arch_ptrace_attach(child) do { } while (0)
-#endif
-
-SYSCALL_DEFINE4(ptrace, long, request, long, pid, long, addr, long, data)
-SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
- unsigned long, data)
-{
- struct task_struct *child;
- long ret;
@ -1880,7 +1881,8 @@ index 23bde94..daed9e8 100644
- return ret;
-}
-
-int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data)
-int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr,
- unsigned long data)
-{
- unsigned long tmp;
- int copied;
@ -1891,7 +1893,8 @@ index 23bde94..daed9e8 100644
- return put_user(tmp, (unsigned long __user *)data);
-}
-
-int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data)
-int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
- unsigned long data)
-{
- int copied;
-