rpms/kernel/devel kernel.spec, 1.155, 1.156 linux-2.6-utrace-ptrace-compat-ia64.patch, 1.4, 1.5 linux-2.6-utrace-ptrace-compat.patch, 1.5, 1.6 linux-2.6-utrace-regset-ia64.patch, 1.3, 1.4 linux-2.6-utrace-regset.patch, 1.5, 1.6 linux-2.6-utrace-tracehook-ia64.patch, 1.3, 1.4 linux-2.6-utrace-tracehook.patch, 1.10, 1.11

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Tue Sep 11 18:04:30 UTC 2007


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11872

Modified Files:
	kernel.spec linux-2.6-utrace-ptrace-compat-ia64.patch 
	linux-2.6-utrace-ptrace-compat.patch 
	linux-2.6-utrace-regset-ia64.patch 
	linux-2.6-utrace-regset.patch 
	linux-2.6-utrace-tracehook-ia64.patch 
	linux-2.6-utrace-tracehook.patch 
Log Message:
* Tue Sep 11 2007 Chuck Ebbert <cebbert at redhat.com>
- utrace update



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -r1.155 -r1.156
--- kernel.spec	11 Sep 2007 17:20:35 -0000	1.155
+++ kernel.spec	11 Sep 2007 18:03:54 -0000	1.156
@@ -1791,6 +1791,9 @@
 
 %changelog
 * Tue Sep 11 2007 Chuck Ebbert <cebbert at redhat.com>
+- utrace update
+
+* Tue Sep 11 2007 Chuck Ebbert <cebbert at redhat.com>
 - Linux 2.6.23-rc6
 
 * Mon Sep 10 2007 Chuck Ebbert <cebbert at redhat.com>

linux-2.6-utrace-ptrace-compat-ia64.patch:

Index: linux-2.6-utrace-ptrace-compat-ia64.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-ptrace-compat-ia64.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-2.6-utrace-ptrace-compat-ia64.patch	11 Sep 2007 17:20:35 -0000	1.4
+++ linux-2.6-utrace-ptrace-compat-ia64.patch	11 Sep 2007 18:03:54 -0000	1.5
@@ -9,8 +9,8 @@
 ---
 
  arch/ia64/ia32/sys_ia32.c |   40 ++
- arch/ia64/kernel/ptrace.c | 1020 +++++----------------------------------------
- 2 files changed, 159 insertions(+), 901 deletions(-)
+ arch/ia64/kernel/ptrace.c | 1019 +++++----------------------------------------
+ 2 files changed, 159 insertions(+), 900 deletions(-)
 
 --- linux-2.6/arch/ia64/ia32/sys_ia32.c
 +++ linux-2.6/arch/ia64/ia32/sys_ia32.c
@@ -977,7 +977,7 @@
  
  /* "asmlinkage" so the input arguments are preserved... */
  
-@@ -1671,6 +770,9 @@ syscall_trace_leave (long arg0, long arg
+@@ -1670,6 +770,9 @@ syscall_trace_leave (long arg0, long arg
  	}
  }
  
@@ -987,7 +987,7 @@
  /* Utrace implementation starts here */
  
  typedef struct utrace_get {
-@@ -2464,3 +1566,119 @@ const struct utrace_regset_view *utrace_
+@@ -2463,3 +1566,119 @@ const struct utrace_regset_view *utrace_
  #endif
  	return &utrace_ia64_native;
  }

linux-2.6-utrace-ptrace-compat.patch:

Index: linux-2.6-utrace-ptrace-compat.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-ptrace-compat.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux-2.6-utrace-ptrace-compat.patch	4 Sep 2007 20:53:27 -0000	1.5
+++ linux-2.6-utrace-ptrace-compat.patch	11 Sep 2007 18:03:54 -0000	1.6
@@ -24,7 +24,7 @@
  arch/powerpc/lib/sstep.c        |    3 
  kernel/fork.c                   |    2 
  kernel/exit.c                   |   13 
- kernel/ptrace.c                 | 2055 +++++++++++++++++++++++++++++++++++++--
+ kernel/ptrace.c                 | 2056 +++++++++++++++++++++++++++++++++++++--
  kernel/sys_ni.c                 |    4 
  kernel/Makefile                 |    3 
  include/linux/sched.h           |    4 
@@ -32,7 +32,7 @@
  include/asm-x86_64/tracehook.h  |    1 
  include/asm-x86_64/ptrace-abi.h |    3 
  init/Kconfig                    |   15 
- 20 files changed, 2642 insertions(+), 780 deletions(-)
+ 20 files changed, 2643 insertions(+), 780 deletions(-)
  delete arch/powerpc/kernel/ptrace32.c
 
 --- linux-2.6/fs/proc/base.c
@@ -1331,7 +1331,7 @@
  		tsk = next_thread(tsk);
 --- linux-2.6/kernel/ptrace.c
 +++ linux-2.6/kernel/ptrace.c
-@@ -19,213 +19,2008 @@
+@@ -19,213 +19,2009 @@
  #include <linux/security.h>
  #include <linux/signal.h>
  #include <linux/syscalls.h>
@@ -1777,11 +1777,8 @@
 +static int ptrace_detach(struct task_struct *task,
 +			 struct utrace_attached_engine *engine,
 +			 struct ptrace_state *state)
- {
--	if (!valid_signal(data))
--		return -EIO;
- 
--	return -ENOSYS;
++{
++
 +	int error;
 +
 +	NO_LOCKS;
@@ -1839,29 +1836,20 @@
 +		spin_unlock_irq(&current->sighand->siglock);
 +	}
 +	return error;
- }
- 
--int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len)
++}
++
 +
 +/*
 + * This is called when we are exiting.  We must stop all our ptracing.
 + */
 +void
 +ptrace_exit(struct task_struct *tsk)
- {
--	int copied = 0;
++{
 +	struct list_head *pos, *n;
 +	int restart;
- 
--	while (len > 0) {
--		char buf[128];
--		int this_len, retval;
++
 +	NO_LOCKS;
- 
--		this_len = (len > sizeof(buf)) ? sizeof(buf) : len;
--		retval = access_process_vm(tsk, src, buf, this_len, 0);
--		if (!retval) {
--			if (copied)
++
 +	/*
 +	 * Taking the task_lock after PF_EXITING is set ensures that a
 +	 * child in ptrace_traceme will not put itself on our list when
@@ -1874,7 +1862,6 @@
 +	}
 +	task_unlock(tsk);
 +
-+	restart = 0;
 +	do {
 +		struct ptrace_state *state;
 +		int error;
@@ -1883,6 +1870,7 @@
 +
 +		rcu_read_lock();
 +
++		restart = 0;
 +		list_for_each_safe_rcu(pos, n, &tsk->ptracees) {
 +			state = list_entry(pos, struct ptrace_state, entry);
 +			error = utrace_detach(state->task, state->engine);
@@ -1904,7 +1892,7 @@
 +				wait_task_inactive(p);
 +				put_task_struct(p);
 +				restart = 1;
- 				break;
++				goto loop_unlocked;
 +			}
 +			else {
 +				BUG_ON(error != -ESRCH);
@@ -1914,10 +1902,11 @@
 +
 +		rcu_read_unlock();
 +
++	loop_unlocked:
 +		END_CHECK;
 +
 +		cond_resched();
-+	} while (restart > 0);
++	} while (unlikely(restart > 0));
 +
 +	if (likely(restart == 0))
 +		/*
@@ -1976,14 +1965,16 @@
 +		     const struct utrace_regset_view *view,
 +		     int setno, unsigned long offset, unsigned int size,
 +		     void __user *data, int write)
-+{
+ {
+-	if (!valid_signal(data))
 +	const struct utrace_regset *regset = utrace_regset(target, engine,
 +							   view, setno);
 +	int ret;
 +
 +	if (unlikely(regset == NULL))
-+		return -EIO;
-+
+ 		return -EIO;
+ 
+-	return -ENOSYS;
 +	if (size == (unsigned int) -1)
 +		size = regset->size * regset->n;
 +
@@ -2003,23 +1994,33 @@
 +	}
 +
 +	return ret;
-+}
-+
+ }
+ 
+-int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len)
 +int
 +ptrace_onereg_access(struct task_struct *target,
 +		     struct utrace_attached_engine *engine,
 +		     const struct utrace_regset_view *view,
 +		     int setno, unsigned long regno,
 +		     void __user *data, int write)
-+{
+ {
+-	int copied = 0;
 +	const struct utrace_regset *regset = utrace_regset(target, engine,
 +							   view, setno);
 +	unsigned int pos;
 +	int ret;
-+
+ 
+-	while (len > 0) {
+-		char buf[128];
+-		int this_len, retval;
 +	if (unlikely(regset == NULL))
 +		return -EIO;
-+
+ 
+-		this_len = (len > sizeof(buf)) ? sizeof(buf) : len;
+-		retval = access_process_vm(tsk, src, buf, this_len, 0);
+-		if (!retval) {
+-			if (copied)
+-				break;
 +	if (regno < regset->bias || regno >= regset->bias + regset->n)
 +		return -EINVAL;
 +
@@ -2191,12 +2192,6 @@
 +				ret = -ESRCH;
 +			if (unlikely(ret))
 +				BUG_ON(ret != -ESRCH);
-+		}
-+
-+		if (ret) {
-+			pr_debug("%d not stopped (%lu)\n",
-+				 child->pid, child->state);
-+			goto out_tsk_rcu;
  		}
 -		if (copy_to_user(dst, buf, retval))
 -			return -EFAULT;
@@ -2205,6 +2200,12 @@
 -		dst += retval;
 -		len -= retval;			
 +
++		if (ret) {
++			pr_debug("%d not stopped (%lu)\n",
++				 child->pid, child->state);
++			goto out_tsk_rcu;
++		}
++
 +		ret = -ESRCH;  /* Return value for exit_state bail-out.  */
  	}
 -	return copied;
@@ -2403,14 +2404,9 @@
 +		if (ret == 0) {
 +			ret = val;
 +			force_successful_syscall_return();
- 		}
--		copied += retval;
--		src += retval;
--		dst += retval;
--		len -= retval;			
++		}
 +		goto out_tsk;
- 	}
--	return copied;
++	}
 +
 +	switch (request) {
 +	default:
@@ -2457,9 +2453,14 @@
 +					   (siginfo_t __user *) data,
 +					   sizeof(siginfo_t)))
 +				ret = -EFAULT;
-+		}
+ 		}
+-		copied += retval;
+-		src += retval;
+-		dst += retval;
+-		len -= retval;			
 +		break;
-+	}
+ 	}
+-	return copied;
 +
 +out_tsk:
 +	NO_LOCKS;
@@ -2556,13 +2557,13 @@
 +	return ret;
  }
 +#endif
-+
  
 -/**
 - * ptrace_traceme  --  helper for PTRACE_TRACEME
 - *
 - * Performs checks and sets PT_PTRACED.
 - * Should be used by all ptrace implementations for PTRACE_TRACEME.
++
 +/*
 + * Detach the zombie being reported for wait.
   */
@@ -2572,13 +2573,13 @@
 +	      struct task_struct *p, struct ptrace_state *state)
  {
 -	int ret = -EPERM;
--
--	ret = security_ptrace(current->parent, current);
--	if (ret)
--		return -EPERM;
 +	int detach_error;
 +	struct utrace_attached_engine *engine;
  
+-	ret = security_ptrace(current->parent, current);
+-	if (ret)
+-		return -EPERM;
+-
 -	return -ENOSYS;
 +restart:
 +	NO_LOCKS;
@@ -2926,7 +2927,7 @@
 -		get_task_struct(child);
 +	if (unlikely(parent->signal == NULL))
 +		goto out;
-+
+ 
 +	sighand = parent->sighand;
 +	spin_lock_irqsave(&sighand->siglock, flags);
 +	if (sighand->action[SIGCHLD-1].sa.sa_handler != SIG_IGN &&
@@ -2937,7 +2938,7 @@
 +	 */
 +	wake_up_interruptible_sync(&parent->signal->wait_chldexit);
 +	spin_unlock_irqrestore(&sighand->siglock, flags);
- 
++
 +out:
  	read_unlock(&tasklist_lock);
 -	if (!child)
@@ -3179,13 +3180,15 @@
 +	NO_LOCKS;
 +	printk(KERN_ERR "ptrace out of memory, lost child %d of %d",
 +	       child->pid, parent->pid);
-+}
-+
+ }
+ 
+-int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data)
 +static u32
 +ptrace_report_clone(struct utrace_attached_engine *engine,
 +		    struct task_struct *parent,
 +		    unsigned long clone_flags, struct task_struct *child)
-+{
+ {
+-	int copied;
 +	int event, option;
 +	struct ptrace_state *state;
 +
@@ -3216,7 +3219,9 @@
 +	}
 +	else
 +		event = 0;
-+
+ 
+-	copied = access_process_vm(tsk, addr, &data, sizeof(data), 1);
+-	return (copied == sizeof(data)) ? 0 : -EIO;
 +	if (!(clone_flags & CLONE_UNTRACED)
 +	    && (event || (clone_flags & CLONE_PTRACE))) {
 +		/*
@@ -3276,7 +3281,7 @@
 +	state->have_eventmsg = 0;
 +	state->u.siginfo = info;
 +	return ptrace_report(engine, tsk, state, signo) | UTRACE_SIGNAL_IGN;
-+}
+ }
 +
 +static u32
 +ptrace_report_jctl(struct utrace_attached_engine *engine,
@@ -3367,14 +3372,12 @@
 +			   struct task_struct *tsk, struct pt_regs *regs)
 +{
 +	return ptrace_report_syscall(engine, tsk, regs, 0);
- }
- 
--int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data)
++}
++
 +static u32
 +ptrace_report_exit(struct utrace_attached_engine *engine,
 +		   struct task_struct *tsk, long orig_code, long *code)
- {
--	int copied;
++{
 +	struct ptrace_state *state = get_ptrace_state(engine, tsk);
 +	if (unlikely(state == NULL))
 +		return UTRACE_ACTION_RESUME;
@@ -3401,11 +3404,9 @@
 +	}
 +
 +	END_CHECK;
- 
--	copied = access_process_vm(tsk, addr, &data, sizeof(data), 1);
--	return (copied == sizeof(data)) ? 0 : -EIO;
++
 +	return unsafe;
- }
++}
 +
 +static struct task_struct *
 +ptrace_tracer_task(struct utrace_attached_engine *engine,

linux-2.6-utrace-regset-ia64.patch:

Index: linux-2.6-utrace-regset-ia64.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-regset-ia64.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- linux-2.6-utrace-regset-ia64.patch	21 Aug 2007 19:42:55 -0000	1.3
+++ linux-2.6-utrace-regset-ia64.patch	11 Sep 2007 18:03:55 -0000	1.4
@@ -603,7 +603,7 @@
  asmlinkage long
  sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data)
  {
-@@ -1602,6 +1617,7 @@ sys_ptrace (long request, pid_t pid, uns
+@@ -1601,6 +1616,7 @@ sys_ptrace (long request, pid_t pid, uns
  	unlock_kernel();
  	return ret;
  }
@@ -611,7 +611,7 @@
  
  /* "asmlinkage" so the input arguments are preserved... */
  
-@@ -1654,3 +1670,797 @@ syscall_trace_leave (long arg0, long arg
+@@ -1653,3 +1669,797 @@ syscall_trace_leave (long arg0, long arg
  		tracehook_report_syscall_step(&regs);
  	}
  }

linux-2.6-utrace-regset.patch:

Index: linux-2.6-utrace-regset.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-regset.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux-2.6-utrace-regset.patch	11 Sep 2007 17:20:35 -0000	1.5
+++ linux-2.6-utrace-regset.patch	11 Sep 2007 18:03:55 -0000	1.6
@@ -19,12 +19,12 @@
  arch/powerpc/kernel/Makefile   |    2 
  arch/powerpc/kernel/ptrace32.c |   20 -
  arch/powerpc/kernel/ptrace.c   |  617 ++++++++++++++++++++----------
- kernel/ptrace.c                |    8 
+ kernel/ptrace.c                |    9 
  include/linux/tracehook.h      |  255 ++++++++++++-
  include/asm-i386/i387.h        |   13 -
  include/asm-x86_64/fpu32.h     |    3 
  include/asm-x86_64/tracehook.h |    8 
- 13 files changed, 2203 insertions(+), 1217 deletions(-)
+ 13 files changed, 2203 insertions(+), 1218 deletions(-)
 
 --- linux-2.6/arch/i386/kernel/i387.c
 +++ linux-2.6/arch/i386/kernel/i387.c
@@ -3841,7 +3841,7 @@
  	return -ENOSYS;
  }
  
-@@ -212,12 +206,10 @@ struct task_struct *ptrace_get_task_stru
+@@ -213,12 +206,10 @@ struct task_struct *ptrace_get_task_stru
  	return child;
  }
  

linux-2.6-utrace-tracehook-ia64.patch:

Index: linux-2.6-utrace-tracehook-ia64.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-tracehook-ia64.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- linux-2.6-utrace-tracehook-ia64.patch	21 Aug 2007 19:42:55 -0000	1.3
+++ linux-2.6-utrace-tracehook-ia64.patch	11 Sep 2007 18:03:55 -0000	1.4
@@ -93,7 +93,7 @@
  #include <linux/smp_lock.h>
  #include <linux/user.h>
  #include <linux/security.h>
-@@ -1602,28 +1603,6 @@ sys_ptrace (long request, pid_t pid, uns
+@@ -1601,28 +1602,6 @@ sys_ptrace (long request, pid_t pid, uns
  	return ret;
  }
  
@@ -122,7 +122,7 @@
  /* "asmlinkage" so the input arguments are preserved... */
  
  asmlinkage void
-@@ -1631,9 +1610,8 @@ syscall_trace_enter (long arg0, long arg
+@@ -1630,9 +1609,8 @@ syscall_trace_enter (long arg0, long arg
  		     long arg4, long arg5, long arg6, long arg7,
  		     struct pt_regs regs)
  {
@@ -134,7 +134,7 @@
  
  	if (unlikely(current->audit_context)) {
  		long syscall;
-@@ -1668,8 +1646,11 @@ syscall_trace_leave (long arg0, long arg
+@@ -1667,8 +1645,11 @@ syscall_trace_leave (long arg0, long arg
  		audit_syscall_exit(success, result);
  	}
  

linux-2.6-utrace-tracehook.patch:

Index: linux-2.6-utrace-tracehook.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-tracehook.patch,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- linux-2.6-utrace-tracehook.patch	11 Sep 2007 17:20:35 -0000	1.10
+++ linux-2.6-utrace-tracehook.patch	11 Sep 2007 18:03:55 -0000	1.11
@@ -47,7 +47,7 @@
  arch/s390/kernel/process.c          |    3 
  arch/frv/kernel/ptrace.c            |   15 -
  arch/i386/math-emu/fpu_entry.c      |    6 -
- arch/i386/kernel/ptrace.c           |  104 ++-------
+ arch/i386/kernel/ptrace.c           |  103 ++-------
  arch/i386/kernel/signal.c           |   37 +--
  arch/i386/kernel/process.c          |    3 
  arch/i386/kernel/vm86.c             |    7 -
@@ -100,7 +100,7 @@
  include/asm-x86_64/thread_info.h    |    3 
  drivers/connector/cn_proc.c         |    4 
  mm/nommu.c                          |    4 
- 67 files changed, 904 insertions(+), 1140 deletions(-)
+ 67 files changed, 904 insertions(+), 1139 deletions(-)
  create include/linux/tracehook.h
  create include/asm-i386/tracehook.h
  create include/asm-powerpc/tracehook.h
@@ -574,7 +574,7 @@
  }
  
  /*
-@@ -476,18 +475,18 @@ long arch_ptrace(struct task_struct *chi
+@@ -475,18 +475,18 @@ long arch_ptrace(struct task_struct *chi
  		if (!valid_signal(data))
  			break;
  		if (request == PTRACE_SYSEMU) {
@@ -597,7 +597,7 @@
  		wake_up_process(child);
  		ret = 0;
  		break;
-@@ -503,7 +502,7 @@ long arch_ptrace(struct task_struct *chi
+@@ -502,7 +502,7 @@ long arch_ptrace(struct task_struct *chi
  			break;
  		child->exit_code = SIGKILL;
  		/* make sure the single step bit is not set. */
@@ -606,7 +606,7 @@
  		wake_up_process(child);
  		break;
  
-@@ -513,13 +512,8 @@ long arch_ptrace(struct task_struct *chi
+@@ -512,13 +512,8 @@ long arch_ptrace(struct task_struct *chi
  		if (!valid_signal(data))
  			break;
  
@@ -621,7 +621,7 @@
  		child->exit_code = data;
  		/* give it a chance to run. */
  		wake_up_process(child);
-@@ -647,78 +641,24 @@ void send_sigtrap(struct task_struct *ts
+@@ -646,78 +641,24 @@ void send_sigtrap(struct task_struct *ts
   * - triggered by current->work.syscall_trace
   */
  __attribute__((regparm(3)))
@@ -2329,7 +2329,7 @@
  int ptrace_detach(struct task_struct *child, unsigned int data)
  {
  	if (!valid_signal(data))
-@@ -234,13 +102,10 @@ int ptrace_detach(struct task_struct *ch
+@@ -235,13 +103,10 @@ int ptrace_detach(struct task_struct *ch
  	ptrace_disable(child);
  	clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
  
@@ -2346,7 +2346,7 @@
  }
  
  int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len)
-@@ -293,103 +158,10 @@ int ptrace_writedata(struct task_struct 
+@@ -294,103 +159,10 @@ int ptrace_writedata(struct task_struct 
  	return copied;
  }
  
@@ -2451,7 +2451,7 @@
  }
  
  /**
-@@ -402,20 +174,11 @@ int ptrace_traceme(void)
+@@ -403,20 +175,11 @@ int ptrace_traceme(void)
  {
  	int ret = -EPERM;
  
@@ -2477,7 +2477,7 @@
  }
  
  /**
-@@ -452,42 +215,7 @@ struct task_struct *ptrace_get_task_stru
+@@ -453,42 +216,7 @@ struct task_struct *ptrace_get_task_stru
  #ifndef __ARCH_SYS_PTRACE
  asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
  {




More information about the scm-commits mailing list