rpms/kernel/devel kernel.spec, 1.1504, 1.1505 linux-2.6-tracehook.patch, 1.8, 1.9 linux-2.6-utrace.patch, 1.109, 1.110 linux-2.6-utrace-ftrace.patch, 1.2, NONE

Roland McGrath roland at fedoraproject.org
Wed Apr 8 01:32:29 UTC 2009


Author: roland

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

Modified Files:
	kernel.spec linux-2.6-tracehook.patch linux-2.6-utrace.patch 
Removed Files:
	linux-2.6-utrace-ftrace.patch 
Log Message:
utrace update, drop unfinished utrace-ftrace


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1504
retrieving revision 1.1505
diff -u -r1.1504 -r1.1505
--- kernel.spec	7 Apr 2009 17:13:39 -0000	1.1504
+++ kernel.spec	8 Apr 2009 01:31:58 -0000	1.1505
@@ -1067,8 +1067,7 @@
 
 # Roland's utrace ptrace replacement.
 ApplyPatch linux-2.6-tracehook.patch
-#ApplyPatch linux-2.6-utrace.patch
-#ApplyPatch linux-2.6-utrace-ftrace.patch
+ApplyPatch linux-2.6-utrace.patch
 
 # enable sysrq-c on all kernels, not only kexec
 ApplyPatch linux-2.6-sysrq-c.patch
@@ -1825,6 +1824,9 @@
 #	                ||----w |
 #	                ||     ||
 %changelog
+* Tue Apr  7 2009 Roland McGrath <roland at redhat.com>
+- utrace update, drop unfinished utrace-ftrace
+
 * Tue Apr 07 2009 Kyle McMartin <kyle at redhat.com>
 - Linux 2.6.29-git15
 - EXT3_DEFAULTS_TO_ORDERED on for now.

linux-2.6-tracehook.patch:

Index: linux-2.6-tracehook.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-tracehook.patch,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- linux-2.6-tracehook.patch	19 Mar 2009 08:03:53 -0000	1.8
+++ linux-2.6-tracehook.patch	8 Apr 2009 01:31:58 -0000	1.9
@@ -19,7 +19,7 @@
  2 files changed, 51 insertions(+), 43 deletions(-)
 
 diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
-index 6186a78..b622498 100644  
+index c7aa154..4ec4821 100644  
 --- a/include/linux/tracehook.h
 +++ b/include/linux/tracehook.h
 @@ -1,7 +1,7 @@
@@ -31,7 +31,7 @@
   *
   * This copyrighted material is made available to anyone wishing to use,
   * modify, copy, or redistribute it subject to the terms and conditions
-@@ -469,22 +469,29 @@ static inline int tracehook_get_signal(s
+@@ -464,22 +464,29 @@ static inline int tracehook_get_signal(s
  
  /**
   * tracehook_notify_jctl - report about job control stop/continue
@@ -70,10 +70,10 @@
  
  #define DEATH_REAP			-1
 diff --git a/kernel/signal.c b/kernel/signal.c
-index 2a74fe8..9a0d98f 100644  
+index d803473..424eff2 100644  
 --- a/kernel/signal.c
 +++ b/kernel/signal.c
-@@ -691,7 +691,7 @@ static int prepare_signal(int sig, struc
+@@ -702,7 +702,7 @@ static int prepare_signal(int sig, struc
  
  		if (why) {
  			/*
@@ -82,7 +82,7 @@
  			 * will take ->siglock, notice SIGNAL_CLD_MASK, and
  			 * notify its parent. See get_signal_to_deliver().
  			 */
-@@ -1629,29 +1629,6 @@ void ptrace_notify(int exit_code)
+@@ -1665,29 +1665,6 @@ void ptrace_notify(int exit_code)
  	spin_unlock_irq(&current->sighand->siglock);
  }
  
@@ -112,7 +112,7 @@
  /*
   * This performs the stopping for SIGSTOP and other stop signals.
   * We have to stop all threads in the thread group.
-@@ -1662,6 +1639,7 @@ static int do_signal_stop(int signr)
+@@ -1698,6 +1675,7 @@ static int do_signal_stop(int signr)
  {
  	struct signal_struct *sig = current->signal;
  	int stop_count;
@@ -120,7 +120,7 @@
  
  	if (sig->group_stop_count > 0) {
  		/*
-@@ -1701,8 +1679,30 @@ static int do_signal_stop(int signr)
+@@ -1737,8 +1715,30 @@ static int do_signal_stop(int signr)
  	current->exit_code = sig->group_exit_code;
  	__set_current_state(TASK_STOPPED);
  
@@ -152,7 +152,7 @@
  	return 1;
  }
  
-@@ -1771,14 +1771,15 @@ relock:
+@@ -1807,14 +1807,15 @@ relock:
  		int why = (signal->flags & SIGNAL_STOP_CONTINUED)
  				? CLD_CONTINUED : CLD_STOPPED;
  		signal->flags &= ~SIGNAL_CLD_MASK;
@@ -174,7 +174,7 @@
  		goto relock;
  	}
  
-@@ -1936,14 +1937,14 @@ void exit_signals(struct task_struct *ts
+@@ -1979,14 +1980,14 @@ void exit_signals(struct task_struct *ts
  	if (unlikely(tsk->signal->group_stop_count) &&
  			!--tsk->signal->group_stop_count) {
  		tsk->signal->flags = SIGNAL_STOP_STOPPED;

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.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- linux-2.6-utrace.patch	23 Mar 2009 02:27:36 -0000	1.109
+++ linux-2.6-utrace.patch	8 Apr 2009 01:31:58 -0000	1.110
@@ -30,17 +30,17 @@
  fs/proc/array.c                   |    3 +
  include/linux/init_task.h         |    1 +
  include/linux/sched.h             |    6 +
- include/linux/tracehook.h         |   50 +-
+ include/linux/tracehook.h         |   61 +-
  include/linux/utrace.h            |  692 +++++++++++
  include/linux/utrace_struct.h     |   58 +
  init/Kconfig                      |    9 +
  kernel/Makefile                   |    1 +
  kernel/ptrace.c                   |   18 +-
- kernel/utrace.c                   | 2348 +++++++++++++++++++++++++++++++++++++
- 12 files changed, 3756 insertions(+), 3 deletions(-)
+ kernel/utrace.c                   | 2351 +++++++++++++++++++++++++++++++++++++
+ 12 files changed, 3770 insertions(+), 3 deletions(-)
 
 diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
-index 1462ed8..f5da1b4 100644  
+index a3a83d3..0a07ba9 100644  
 --- a/Documentation/DocBook/Makefile
 +++ b/Documentation/DocBook/Makefile
 @@ -9,7 +9,7 @@
@@ -51,7 +51,7 @@
 +	    kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml utrace.xml \
  	    gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
  	    genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
- 	    mac80211.xml debugobjects.xml sh.xml regulator.xml
+ 	    mac80211.xml debugobjects.xml sh.xml regulator.xml \
 diff --git a/Documentation/DocBook/utrace.tmpl b/Documentation/DocBook/utrace.tmpl
 new file mode 100644
 index ...b802c55 100644  
@@ -651,10 +651,10 @@
  	if (p->files)
  		fdt = files_fdtable(p->files);
 diff --git a/include/linux/init_task.h b/include/linux/init_task.h
-index e752d97..39eebc8 100644  
+index dcfb933..5625de6 100644  
 --- a/include/linux/init_task.h
 +++ b/include/linux/init_task.h
-@@ -181,6 +181,7 @@ extern struct cred init_cred;
+@@ -183,6 +183,7 @@ extern struct cred init_cred;
  		[PIDTYPE_SID]  = INIT_PID_LINK(PIDTYPE_SID),		\
  	},								\
  	.dirties = INIT_PROP_LOCAL_SINGLE(dirties),			\
@@ -663,7 +663,7 @@
  	INIT_TRACE_IRQFLAGS						\
  	INIT_LOCKDEP							\
 diff --git a/include/linux/sched.h b/include/linux/sched.h
-index 011db2f..786ef2d 100644  
+index 98e1fe5..e9c3350 100644  
 --- a/include/linux/sched.h
 +++ b/include/linux/sched.h
 @@ -59,6 +59,7 @@ struct sched_param {
@@ -674,7 +674,7 @@
  
  #include <asm/system.h>
  #include <asm/page.h>
-@@ -1287,6 +1288,11 @@ struct task_struct {
+@@ -1290,6 +1291,11 @@ struct task_struct {
  #endif
  	seccomp_t seccomp;
  
@@ -687,7 +687,7 @@
     	u32 parent_exec_id;
     	u32 self_exec_id;
 diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
-index b622498..6ff7277 100644  
+index 4ec4821..a7de30f 100644  
 --- a/include/linux/tracehook.h
 +++ b/include/linux/tracehook.h
 @@ -49,6 +49,7 @@
@@ -796,18 +796,18 @@
  	if (stepping)
  		ptrace_notify(SIGTRAP);
  }
-@@ -400,6 +422,8 @@ static inline int tracehook_consider_ign
- 						    int sig,
- 						    void __user *handler)
+@@ -397,6 +419,8 @@ static inline void tracehook_signal_hand
+ static inline int tracehook_consider_ignored_signal(struct task_struct *task,
+ 						    int sig)
  {
 +	if (unlikely(task_utrace_flags(task) & UTRACE_EVENT(SIGNAL_IGN)))
 +		return 1;
  	return (task_ptrace(task) & PT_PTRACED) != 0;
  }
  
-@@ -421,6 +445,9 @@ static inline int tracehook_consider_fat
- 						  int sig,
- 						  void __user *handler)
+@@ -416,6 +440,9 @@ static inline int tracehook_consider_ign
+ static inline int tracehook_consider_fatal_signal(struct task_struct *task,
+ 						  int sig)
  {
 +	if (unlikely(task_utrace_flags(task) & (UTRACE_EVENT(SIGNAL_TERM) |
 +						UTRACE_EVENT(SIGNAL_CORE))))
@@ -815,7 +815,7 @@
  	return (task_ptrace(task) & PT_PTRACED) != 0;
  }
  
-@@ -435,6 +462,8 @@ static inline int tracehook_consider_fat
+@@ -430,6 +457,8 @@ static inline int tracehook_consider_fat
   */
  static inline int tracehook_force_sigpending(void)
  {
@@ -824,7 +824,7 @@
  	return 0;
  }
  
-@@ -464,6 +493,8 @@ static inline int tracehook_get_signal(s
+@@ -459,6 +488,8 @@ static inline int tracehook_get_signal(s
  				       siginfo_t *info,
  				       struct k_sigaction *return_ka)
  {
@@ -833,7 +833,7 @@
  	return 0;
  }
  
-@@ -491,6 +522,8 @@ static inline int tracehook_get_signal(s
+@@ -486,6 +517,8 @@ static inline int tracehook_get_signal(s
   */
  static inline int tracehook_notify_jctl(int notify, int why)
  {
@@ -842,26 +842,37 @@
  	return notify ?: (current->ptrace & PT_PTRACED) ? why : 0;
  }
  
-@@ -514,6 +547,8 @@ static inline int tracehook_notify_jctl(
+@@ -509,6 +542,8 @@ static inline int tracehook_notify_jctl(
  static inline int tracehook_notify_death(struct task_struct *task,
  					 void **death_cookie, int group_dead)
  {
 +	*death_cookie = task_utrace_struct(task);
 +
- 	if (task->exit_signal == -1)
+ 	if (task_detached(task))
  		return task->ptrace ? SIGCHLD : DEATH_REAP;
  
-@@ -550,6 +585,9 @@ static inline void tracehook_report_deat
+@@ -545,6 +580,20 @@ static inline void tracehook_report_deat
  					  int signal, void *death_cookie,
  					  int group_dead)
  {
++	/*
++	 * This barrier ensures that our caller's setting of
++	 * @task->exit_state precedes checking @task->utrace_flags here.
++	 * If utrace_set_events() was just called to enable
++	 * UTRACE_EVENT(DEATH), then we are obliged to call
++	 * utrace_report_death() and not miss it.  utrace_set_events()
++	 * uses tasklist_lock to synchronize enabling the bit with the
++	 * actual change to @task->exit_state, but we need this barrier
++	 * to be sure we see a flags change made just before our caller
++	 * took the tasklist_lock.
++	 */
 +	smp_mb();
 +	if (task_utrace_flags(task) & _UTRACE_DEATH_EVENTS)
 +		utrace_report_death(task, death_cookie, group_dead, signal);
  }
  
  #ifdef TIF_NOTIFY_RESUME
-@@ -579,10 +617,20 @@ static inline void set_notify_resume(str
+@@ -574,10 +623,20 @@ static inline void set_notify_resume(str
   * asynchronously, this will be called again before we return to
   * user mode.
   *
@@ -1646,10 +1657,10 @@
 +
 +#endif	/* linux/utrace_struct.h */
 diff --git a/init/Kconfig b/init/Kconfig
-index 6a5c5fe..4b5ab3e 100644  
+index f2f9b53..0d104d9 100644  
 --- a/init/Kconfig
 +++ b/init/Kconfig
-@@ -1060,6 +1060,15 @@ config STOP_MACHINE
+@@ -1141,6 +1141,15 @@ config STOP_MACHINE
  	help
  	  Need stop_machine() primitive.
  
@@ -1666,7 +1677,7 @@
  
  config PREEMPT_NOTIFIERS
 diff --git a/kernel/Makefile b/kernel/Makefile
-index e4791b3..7bff724 100644  
+index 4242366..a79634e 100644  
 --- a/kernel/Makefile
 +++ b/kernel/Makefile
 @@ -68,6 +68,7 @@ obj-$(CONFIG_IKCONFIG) += configs.o
@@ -1678,7 +1689,7 @@
  obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
  obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
 diff --git a/kernel/ptrace.c b/kernel/ptrace.c
-index c9cf48b..41e9542 100644  
+index aaad0ec..8ba9b73 100644  
 --- a/kernel/ptrace.c
 +++ b/kernel/ptrace.c
 @@ -16,6 +16,7 @@
@@ -1689,7 +1700,7 @@
  #include <linux/security.h>
  #include <linux/signal.h>
  #include <linux/audit.h>
-@@ -172,6 +173,14 @@ bool ptrace_may_access(struct task_struc
+@@ -176,6 +177,14 @@ bool ptrace_may_access(struct task_struc
  	return (!err ? true : false);
  }
  
@@ -1704,7 +1715,7 @@
  int ptrace_attach(struct task_struct *task)
  {
  	int retval;
-@@ -210,6 +219,11 @@ repeat:
+@@ -214,6 +223,11 @@ repeat:
  		goto repeat;
  	}
  
@@ -1716,7 +1727,7 @@
  	if (!task->mm)
  		goto bad;
  	/* the same process cannot be attached many times */
-@@ -515,7 +529,9 @@ int ptrace_traceme(void)
+@@ -590,7 +604,9 @@ int ptrace_traceme(void)
  	 */
  repeat:
  	task_lock(current);
@@ -1729,10 +1740,10 @@
  		 */
 diff --git a/kernel/utrace.c b/kernel/utrace.c
 new file mode 100644
-index ...115be79 100644  
+index ...c2bb162 100644  
 --- /dev/null
 +++ b/kernel/utrace.c
-@@ -0,0 +1,2348 @@
+@@ -0,0 +1,2351 @@
 +/*
 + * utrace infrastructure interface for debugging user processes
 + *
@@ -3249,25 +3260,7 @@
 +		 */
 +		return true;
 +
-+	if (unlikely(report.result == UTRACE_SYSCALL_ABORT))
-+		return true;
-+
-+	if (signal_pending(task)) {
-+		/*
-+		 * Clear TIF_SIGPENDING if it no longer needs to be set.
-+		 * It may have been set as part of quiescence, and won't
-+		 * ever have been cleared by another thread.  For other
-+		 * reports, we can just leave it set and will go through
-+		 * utrace_get_signal() to reset things.  But here we are
-+		 * about to enter a syscall, which might bail out with an
-+		 * -ERESTART* error if it's set now.
-+		 */
-+		spin_lock_irq(&task->sighand->siglock);
-+		recalc_sigpending();
-+		spin_unlock_irq(&task->sighand->siglock);
-+	}
-+
-+	return false;
++	return report.result == UTRACE_SYSCALL_ABORT;
 +}
 +
 +/*
@@ -3498,12 +3491,29 @@
 +			set_tsk_thread_flag(task, TIF_SIGPENDING);
 +		break;
 +
-+	case UTRACE_SINGLESTEP:
-+		user_enable_single_step(task);
-+		break;
-+
 +	case UTRACE_BLOCKSTEP:
-+		user_enable_block_step(task);
++		if (likely(arch_has_block_step())) {
++			user_enable_block_step(task);
++			break;
++		}
++
++		/*
++		 * This means some callback is to blame for failing
++		 * to check arch_has_block_step() itself.  Warn and
++		 * then fall through to treat it as SINGLESTEP.
++		 */
++		WARN_ON(1);
++
++	case UTRACE_SINGLESTEP:
++		if (likely(arch_has_single_step()))
++			user_enable_single_step(task);
++		else
++			/*
++			 * This means some callback is to blame for failing
++			 * to check arch_has_single_step() itself.  Spew
++			 * about it so the loser will fix his module.
++			 */
++			WARN_ON(1);
 +		break;
 +
 +	case UTRACE_REPORT:
@@ -3548,11 +3558,15 @@
 +	}
 +
 +	/*
-+	 * If UTRACE_INTERRUPT was just used, we don't bother with a
-+	 * report here.  We will report and stop in utrace_get_signal().
++	 * If UTRACE_INTERRUPT was just used, we don't bother with a report
++	 * here.  We will report and stop in utrace_get_signal().  In case
++	 * of a race with utrace_control(), make sure we don't momentarily
++	 * return to user mode because TIF_SIGPENDING was not set yet.
 +	 */
-+	if (unlikely(utrace->interrupt))
++	if (unlikely(utrace->interrupt)) {
++		set_thread_flag(TIF_SIGPENDING);
 +		return;
++	}
 +
 +	/*
 +	 * Do a simple reporting pass, with no callback after report_quiesce.


--- linux-2.6-utrace-ftrace.patch DELETED ---




More information about the fedora-extras-commits mailing list