From 1aea2328b45aa547a36a8db2b75032727c1672a7 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 8 Nov 2010 10:38:33 -0500 Subject: [PATCH] Cherry-pick utrace-ptrace fixes from mayoung. Thanks! --- config-generic | 1 - kernel.spec | 5 ++++- linux-2.6-utrace-ptrace.patch | 35 +++++++++++++++++++---------------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/config-generic b/config-generic index a4ff8cfeb..9a0b10bc7 100644 --- a/config-generic +++ b/config-generic @@ -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 diff --git a/kernel.spec b/kernel.spec index f8c30f610..772f21ad1 100644 --- a/kernel.spec +++ b/kernel.spec @@ -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 +- Cherry-pick utrace-ptrace fixes from mayoung. Thanks! + * Tue Nov 02 2010 Kyle McMartin 2.6.37-0.1.rc1.git0 - Linux 2.6.37-rc1 diff --git a/linux-2.6-utrace-ptrace.patch b/linux-2.6-utrace-ptrace.patch index a609fb628..caeae6760 100644 --- a/linux-2.6-utrace-ptrace.patch +++ b/linux-2.6-utrace-ptrace.patch @@ -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; -