rpms/kernel/F-7 kernel-2.6.spec, 1.3338, 1.3339 linux-2.6-utrace-core.patch, 1.4, 1.5 linux-2.6-utrace-ptrace-compat.patch, 1.4, 1.5

Roland McGrath (roland) fedora-extras-commits at redhat.com
Wed Sep 12 00:18:17 UTC 2007


Author: roland

Update of /cvs/pkgs/rpms/kernel/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18429

Modified Files:
	kernel-2.6.spec linux-2.6-utrace-core.patch 
	linux-2.6-utrace-ptrace-compat.patch 
Log Message:
utrace update (#248532, #267161, #284311)


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3338
retrieving revision 1.3339
diff -u -r1.3338 -r1.3339
--- kernel-2.6.spec	5 Sep 2007 16:18:54 -0000	1.3338
+++ kernel-2.6.spec	12 Sep 2007 00:17:42 -0000	1.3339
@@ -478,7 +478,7 @@
 Patch00: patch-2.6.%{base_sublevel}.%{stable_update}.bz2
 
 # non-released_kernel case
-# These are automagically defined by the rcrev and gitrev values set up 
+# These are automagically defined by the rcrev and gitrev values set up
 # near the top of this spec file.
 %else
 %if 0%{?rcrev}
@@ -2306,8 +2306,8 @@
 %endif
 
 %changelog
-* Wed Sep 05 2007 Chuck Ebbert <cebbert at redhat.com>
-- Update utrace
+* Tue Sep 11 2007 Roland McGrath <roland at redhat.com>
+- utrace update (#248532, #267161, #284311)
 
 * Thu Aug 30 2007 John W. Linville <linville at redhat.com>
 - Update bits from wireless-2.6 and wireless-dev

linux-2.6-utrace-core.patch:

Index: linux-2.6-utrace-core.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/linux-2.6-utrace-core.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-2.6-utrace-core.patch	5 Sep 2007 16:18:54 -0000	1.4
+++ linux-2.6-utrace-core.patch	12 Sep 2007 00:17:42 -0000	1.5
@@ -27,8 +27,8 @@
  include/linux/utrace.h            |  544 ++++++++
  init/Kconfig                      |   18 
  kernel/Makefile                   |    1 
- kernel/utrace.c                   | 2344 ++++++++++++++++++++++++++++++++++++++
- 9 files changed, 3583 insertions(+), 18 deletions(-)
+ kernel/utrace.c                   | 2359 ++++++++++++++++++++++++++++++++++++++
+ 9 files changed, 3598 insertions(+), 18 deletions(-)
  create kernel/utrace.c
  create Documentation/utrace.txt
  create Documentation/DocBook/utrace.tmpl
@@ -50,7 +50,7 @@
 ===================================================================
 --- /dev/null
 +++ b/kernel/utrace.c
-@@ -0,0 +1,2344 @@
+@@ -0,0 +1,2359 @@
 +/*
 + * utrace infrastructure interface for debugging user processes
 + *
@@ -2008,13 +2008,28 @@
 +	 */
 +	if (signal.signr != 0) {
 +		if (signal.return_ka == NULL) {
-+			ka = &tsk->sighand->action[signal.signr - 1];
++			/*
++			 * utrace_inject_signal recorded this to have us
++			 * use the injected signal's normal sigaction.  We
++			 * have to perform the SA_ONESHOT work now because
++			 * our caller will never touch the real sigaction.
++			 */
++			ka = &tsk->sighand->action[info->si_signo - 1];
++			*return_ka = *ka;
 +			if (ka->sa.sa_flags & SA_ONESHOT)
 +				ka->sa.sa_handler = SIG_DFL;
-+			*return_ka = *ka;
 +		}
 +		else
 +			BUG_ON(signal.return_ka != return_ka);
++
++		/*
++		 * We already processed the SA_ONESHOT work ahead of time.
++		 * Once we return nonzero, our caller will only refer to
++		 * return_ka.  So we must clear the flag to be sure it
++		 * doesn't clear return_ka->sa.sa_handler.
++		 */
++		return_ka->sa.sa_flags &= ~SA_ONESHOT;
++
 +		return signal.signr;
 +	}
 +

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

Index: linux-2.6-utrace-ptrace-compat.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/linux-2.6-utrace-ptrace-compat.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-2.6-utrace-ptrace-compat.patch	5 Sep 2007 16:18:54 -0000	1.4
+++ linux-2.6-utrace-ptrace-compat.patch	12 Sep 2007 00:17:42 -0000	1.5
@@ -28,9 +28,9 @@
  kernel/Makefile                 |    3 
  kernel/exit.c                   |   13 
  kernel/fork.c                   |    2 
- kernel/ptrace.c                 | 2052 +++++++++++++++++++++++++++++++++++++---
+ kernel/ptrace.c                 | 2053 +++++++++++++++++++++++++++++++++++++---
  kernel/sys_ni.c                 |    4 
- 18 files changed, 2633 insertions(+), 174 deletions(-)
+ 18 files changed, 2634 insertions(+), 174 deletions(-)
 
 Index: b/fs/proc/base.c
 ===================================================================
@@ -683,7 +683,7 @@
 ===================================================================
 --- a/kernel/ptrace.c
 +++ b/kernel/ptrace.c
-@@ -19,194 +19,2008 @@
+@@ -19,194 +19,2009 @@
  #include <linux/security.h>
  #include <linux/signal.h>
  #include <linux/syscalls.h>
@@ -1131,9 +1131,7 @@
 +			 struct ptrace_state *state)
  {
 -	if (!valid_signal(data))
--		return -EIO;
- 
--	return -ENOSYS;
++
 +	int error;
 +
 +	NO_LOCKS;
@@ -1191,29 +1189,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
@@ -1226,7 +1215,6 @@
 +	}
 +	task_unlock(tsk);
 +
-+	restart = 0;
 +	do {
 +		struct ptrace_state *state;
 +		int error;
@@ -1235,6 +1223,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);
@@ -1256,7 +1245,7 @@
 +				wait_task_inactive(p);
 +				put_task_struct(p);
 +				restart = 1;
- 				break;
++				goto loop_unlocked;
 +			}
 +			else {
 +				BUG_ON(error != -ESRCH);
@@ -1266,10 +1255,11 @@
 +
 +		rcu_read_unlock();
 +
++	loop_unlocked:
 +		END_CHECK;
 +
 +		cond_resched();
-+	} while (restart > 0);
++	} while (unlikely(restart > 0));
 +
 +	if (likely(restart == 0))
 +		/*
@@ -1291,8 +1281,9 @@
 +		return 0;
 +
 +	if (!valid_signal(signr))
-+		return -EIO;
-+
+ 		return -EIO;
+ 
+-	return -ENOSYS;
 +	if (state->syscall) {
 +		/*
 +		 * This is the traditional ptrace behavior when given
@@ -1320,22 +1311,32 @@
 +	}
 +
 +	return 0;
-+}
-+
+ }
+ 
+-int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len)
 +int
 +ptrace_regset_access(struct task_struct *target,
 +		     struct utrace_attached_engine *engine,
 +		     const struct utrace_regset_view *view,
 +		     int setno, unsigned long offset, unsigned int size,
 +		     void __user *data, int write)
-+{
+ {
+-	int copied = 0;
 +	const struct utrace_regset *regset = utrace_regset(target, engine,
 +							   view, setno);
 +	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 (size == (unsigned int) -1)
 +		size = regset->size * regset->n;
 +
@@ -1460,13 +1461,7 @@
 +			else
 +				ret = (*regset->get)(target, regset,
 +						     pos, n, kdata, udata);
- 		}
--		if (copy_to_user(dst, buf, retval))
--			return -EFAULT;
--		copied += retval;
--		src += retval;
--		dst += retval;
--		len -= retval;			
++		}
 +
 +		if (kdata)
 +			kdata += n;
@@ -1514,8 +1509,7 @@
 +	if (request == PTRACE_ATTACH) {
 +		ret = ptrace_attach(child);
 +		goto out_tsk;
- 	}
--	return copied;
++	}
 +
 +	rcu_read_lock();
 +	engine = utrace_attach(child, UTRACE_ATTACH_MATCH_OPS,
@@ -1542,7 +1536,13 @@
 +			if (child->state == TASK_STOPPED)
 +				ret = 0;
 +			unlock_task_sighand(child, &flags);
-+		}
+ 		}
+-		if (copy_to_user(dst, buf, retval))
+-			return -EFAULT;
+-		copied += retval;
+-		src += retval;
+-		dst += retval;
+-		len -= retval;			
 +		if (ret == 0) {
 +			ret = ptrace_update(child, state,
 +					    UTRACE_ACTION_QUIESCE, 0);
@@ -1559,7 +1559,8 @@
 +		}
 +
 +		ret = -ESRCH;  /* Return value for exit_state bail-out.  */
-+	}
+ 	}
+-	return copied;
 +
 +	rcu_read_unlock();
 +




More information about the fedora-extras-commits mailing list