rpms/kernel/devel kernel.spec, 1.1577, 1.1578 linux-2.6-utrace.patch, 1.115, 1.116

Kyle McMartin kyle at fedoraproject.org
Fri Jun 19 22:37:59 UTC 2009


Author: kyle

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18863

Modified Files:
	kernel.spec linux-2.6-utrace.patch 
Log Message:
* Fri Jun 19 2009 Kyle McMartin <kyle at redhat.com> 2.6.31.0.15.rc0.git14
- Fix up ptrace, hopefully. Builds on x86_64 at least.



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1577
retrieving revision 1.1578
diff -u -p -r1.1577 -r1.1578
--- kernel.spec	19 Jun 2009 22:21:31 -0000	1.1577
+++ kernel.spec	19 Jun 2009 22:37:26 -0000	1.1578
@@ -1823,6 +1823,9 @@ fi
 # and build.
 
 %changelog
+* Fri Jun 19 2009 Kyle McMartin <kyle at redhat.com> 2.6.31.0.15.rc0.git14
+- Fix up ptrace, hopefully. Builds on x86_64 at least.
+
 * Fri Jun 19 2009 Chuck Ebbert <cebbert at redhat.com>
 - linux-2.6-tip.git-203abd67b75f7714ce98ab0cdbd6cfd7ad79dec4.patch
   Fixes oops on boot with qemu (#507007)

linux-2.6-utrace.patch:

Index: linux-2.6-utrace.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace.patch,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -p -r1.115 -r1.116
--- linux-2.6-utrace.patch	19 Jun 2009 22:06:34 -0000	1.115
+++ linux-2.6-utrace.patch	19 Jun 2009 22:37:26 -0000	1.116
@@ -1667,7 +1667,7 @@ index 0a32cb2..2518707 100644
  obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
  obj-$(CONFIG_GCOV_KERNEL) += gcov/
 diff --git a/kernel/ptrace.c b/kernel/ptrace.c
-index 61c78b2..b96f9f1 100644
+index 61c78b2..935eeee 100644
 --- a/kernel/ptrace.c
 +++ b/kernel/ptrace.c
 @@ -16,6 +16,7 @@
@@ -1707,60 +1707,23 @@ index 61c78b2..b96f9f1 100644
  	retval = __ptrace_may_access(task, PTRACE_MODE_ATTACH);
  	task_unlock(task);
  	if (retval)
-@@ -577,7 +593,65 @@ int ptrace_request(struct task_struct *child, long request,
+@@ -226,7 +242,9 @@ int ptrace_traceme(void)
+ 
+ 	write_lock_irq(&tasklist_lock);
+ 	/* Are we already being traced? */
+-	if (!current->ptrace) {
++	if (exclude_ptrace(current)) {
++		ret = -EBUSY;
++	} else if (!current->ptrace) {
+ 		ret = security_ptrace_traceme(current->parent);
+ 		/*
+ 		 * Check PF_EXITING to ensure ->real_parent has not passed
+@@ -577,7 +595,17 @@ int ptrace_request(struct task_struct *child, long request,
  	return ret;
  }
  
 -static struct task_struct *ptrace_get_task_struct(pid_t pid)
 +/**
-+ * ptrace_traceme  --  helper for PTRACE_TRACEME
-+ *
-+ * Performs checks and sets PT_PTRACED.
-+ * Should be used by all ptrace implementations for PTRACE_TRACEME.
-+ */
-+int ptrace_traceme(void)
-+{
-+	int ret = -EPERM;
-+
-+	/*
-+	 * Are we already being traced?
-+	 */
-+repeat:
-+	task_lock(current);
-+	if (exclude_ptrace(current)) {
-+		ret = -EBUSY;
-+	} else if (!(current->ptrace & PT_PTRACED)) {
-+		/*
-+		 * See ptrace_attach() comments about the locking here.
-+		 */
-+		unsigned long flags;
-+		if (!write_trylock_irqsave(&tasklist_lock, flags)) {
-+			task_unlock(current);
-+			do {
-+				cpu_relax();
-+			} while (!write_can_lock(&tasklist_lock));
-+			goto repeat;
-+		}
-+
-+		ret = security_ptrace_traceme(current->parent);
-+
-+		/*
-+		 * Check PF_EXITING to ensure ->real_parent has not passed
-+		 * exit_ptrace(). Otherwise we don't report the error but
-+		 * pretend ->real_parent untraces us right after return.
-+		 */
-+		if (!ret && !(current->real_parent->flags & PF_EXITING)) {
-+			current->ptrace |= PT_PTRACED;
-+			__ptrace_link(current, current->real_parent);
-+		}
-+
-+		write_unlock_irqrestore(&tasklist_lock, flags);
-+	}
-+	task_unlock(current);
-+	return ret;
-+}
-+
-+/**
 + * ptrace_get_task_struct  --  grab a task struct reference for ptrace
 + * @pid:       process id to grab a task_struct reference of
 + *




More information about the fedora-extras-commits mailing list