rpms/kernel/devel kernel.spec, 1.107, 1.108 linux-2.6-utrace-core.patch, 1.4, 1.5 linux-2.6-utrace-ptrace-compat-avr32.patch, 1.2, 1.3 linux-2.6-utrace-ptrace-compat-ia64.patch, 1.2, 1.3 linux-2.6-utrace-ptrace-compat-s390.patch, 1.1, 1.2 linux-2.6-utrace-ptrace-compat-sparc64.patch, 1.1, 1.2 linux-2.6-utrace-ptrace-compat.patch, 1.3, 1.4 linux-2.6-utrace-regset-avr32.patch, 1.2, 1.3 linux-2.6-utrace-regset-ia64.patch, 1.2, 1.3 linux-2.6-utrace-regset-s390.patch, 1.2, 1.3 linux-2.6-utrace-regset-sparc64.patch, 1.2, 1.3 linux-2.6-utrace-regset.patch, 1.3, 1.4 linux-2.6-utrace-tracehook-ia64.patch, 1.2, 1.3 linux-2.6-utrace-tracehook.patch, 1.6, 1.7

Dave Jones (davej) fedora-extras-commits at redhat.com
Tue Aug 21 19:43:32 UTC 2007


Author: davej

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

Modified Files:
	kernel.spec linux-2.6-utrace-core.patch 
	linux-2.6-utrace-ptrace-compat-avr32.patch 
	linux-2.6-utrace-ptrace-compat-ia64.patch 
	linux-2.6-utrace-ptrace-compat-s390.patch 
	linux-2.6-utrace-ptrace-compat-sparc64.patch 
	linux-2.6-utrace-ptrace-compat.patch 
	linux-2.6-utrace-regset-avr32.patch 
	linux-2.6-utrace-regset-ia64.patch 
	linux-2.6-utrace-regset-s390.patch 
	linux-2.6-utrace-regset-sparc64.patch 
	linux-2.6-utrace-regset.patch 
	linux-2.6-utrace-tracehook-ia64.patch 
	linux-2.6-utrace-tracehook.patch 
Log Message:
* Tue Aug 21 2007 Dave Jones <davej at redhat.com>
Rebase utrace.



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- kernel.spec	20 Aug 2007 20:27:18 -0000	1.107
+++ kernel.spec	21 Aug 2007 19:42:55 -0000	1.108
@@ -950,7 +950,6 @@
 # patch-2.6.23-rc3-hrt2.patch
 ApplyPatch linux-2.6-highres-timers.patch
 
-%if 0
 # Roland's utrace ptrace replacement.
 # Main patch includes i386, x86_64, powerpc.
 ApplyPatch linux-2.6-utrace-tracehook.patch
@@ -979,7 +978,6 @@
 
 # setuid /proc/self/maps fix. (dependent on utrace)
 ApplyPatch linux-2.6-proc-self-maps-fix.patch
-%endif
 
 # Nouveau DRM
 #ApplyPatch nouveau-drm.patch
@@ -1757,6 +1755,9 @@
 
 
 %changelog
+* Tue Aug 21 2007 Dave Jones <davej at redhat.com>
+Rebase utrace.
+
 * Mon Aug 20 2007 Dave Jones <davej at redhat.com>
 - Add new variant of lparmap ppc buildfix
 

linux-2.6-utrace-core.patch:

Index: linux-2.6-utrace-core.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/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	31 Jul 2007 18:25:55 -0000	1.4
+++ linux-2.6-utrace-core.patch	21 Aug 2007 19:42:55 -0000	1.5
@@ -2939,7 +2939,7 @@
  struct linux_binprm;
  struct pt_regs;
  
-@@ -342,6 +343,7 @@ utrace_regset_copyin_ignore(unsigned int
+@@ -353,6 +354,7 @@ utrace_regset_copyin_ignore(unsigned int
   */
  static inline void tracehook_init_task(struct task_struct *child)
  {
@@ -2947,7 +2947,7 @@
  }
  
  /*
-@@ -350,6 +352,9 @@ static inline void tracehook_init_task(s
+@@ -361,6 +363,9 @@ static inline void tracehook_init_task(s
   */
  static inline void tracehook_release_task(struct task_struct *p)
  {
@@ -2957,7 +2957,7 @@
  }
  
  /*
-@@ -359,7 +364,20 @@ static inline void tracehook_release_tas
+@@ -370,7 +375,20 @@ static inline void tracehook_release_tas
   */
  static inline int tracehook_check_released(struct task_struct *p)
  {
@@ -2979,7 +2979,7 @@
  }
  
  /*
-@@ -370,7 +388,7 @@ static inline int tracehook_check_releas
+@@ -381,7 +399,7 @@ static inline int tracehook_check_releas
  static inline int tracehook_notify_cldstop(struct task_struct *tsk,
  					   const siginfo_t *info)
  {
@@ -2988,7 +2988,7 @@
  }
  
  /*
-@@ -384,7 +402,11 @@ static inline int tracehook_notify_cldst
+@@ -395,7 +413,11 @@ static inline int tracehook_notify_cldst
  static inline int tracehook_notify_death(struct task_struct *tsk,
  					 int *noreap, void **death_cookie)
  {
@@ -3001,7 +3001,7 @@
  	*noreap = 0;
  	return 0;
  }
-@@ -397,7 +419,8 @@ static inline int tracehook_notify_death
+@@ -408,7 +430,8 @@ static inline int tracehook_notify_death
  static inline int tracehook_consider_fatal_signal(struct task_struct *tsk,
  						  int sig)
  {
@@ -3011,7 +3011,7 @@
  }
  
  /*
-@@ -410,7 +433,7 @@ static inline int tracehook_consider_ign
+@@ -421,7 +444,7 @@ static inline int tracehook_consider_ign
  						    int sig,
  						    void __user *handler)
  {
@@ -3020,7 +3020,7 @@
  }
  
  
-@@ -421,7 +444,7 @@ static inline int tracehook_consider_ign
+@@ -432,7 +455,7 @@ static inline int tracehook_consider_ign
   */
  static inline int tracehook_induce_sigpending(struct task_struct *tsk)
  {
@@ -3029,7 +3029,7 @@
  }
  
  /*
-@@ -436,6 +459,8 @@ static inline int tracehook_get_signal(s
+@@ -447,6 +470,8 @@ static inline int tracehook_get_signal(s
  				       siginfo_t *info,
  				       struct k_sigaction *return_ka)
  {
@@ -3038,7 +3038,7 @@
  	return 0;
  }
  
-@@ -448,6 +473,8 @@ static inline int tracehook_get_signal(s
+@@ -459,6 +484,8 @@ static inline int tracehook_get_signal(s
   */
  static inline int tracehook_finish_stop(int last_one)
  {
@@ -3047,7 +3047,7 @@
  	return 0;
  }
  
-@@ -459,7 +486,7 @@ static inline int tracehook_finish_stop(
+@@ -470,7 +497,7 @@ static inline int tracehook_finish_stop(
   */
  static inline int tracehook_inhibit_wait_stopped(struct task_struct *child)
  {
@@ -3056,7 +3056,7 @@
  }
  
  /*
-@@ -469,7 +496,7 @@ static inline int tracehook_inhibit_wait
+@@ -480,7 +507,7 @@ static inline int tracehook_inhibit_wait
   */
  static inline int tracehook_inhibit_wait_zombie(struct task_struct *child)
  {
@@ -3065,7 +3065,7 @@
  }
  
  /*
-@@ -479,7 +506,7 @@ static inline int tracehook_inhibit_wait
+@@ -490,7 +517,7 @@ static inline int tracehook_inhibit_wait
   */
  static inline int tracehook_inhibit_wait_continued(struct task_struct *child)
  {
@@ -3074,7 +3074,7 @@
  }
  
  
-@@ -489,13 +516,9 @@ static inline int tracehook_inhibit_wait
+@@ -500,13 +527,9 @@ static inline int tracehook_inhibit_wait
   */
  static inline int tracehook_unsafe_exec(struct task_struct *tsk)
  {
@@ -3090,7 +3090,7 @@
  }
  
  /*
-@@ -510,6 +533,8 @@ static inline int tracehook_unsafe_exec(
+@@ -521,6 +544,8 @@ static inline int tracehook_unsafe_exec(
   */
  static inline struct task_struct *tracehook_tracer_task(struct task_struct *p)
  {
@@ -3099,7 +3099,7 @@
  	return NULL;
  }
  
-@@ -521,6 +546,8 @@ static inline int tracehook_allow_access
+@@ -532,6 +557,8 @@ static inline int tracehook_allow_access
  {
  	if (tsk == current)
  		return 1;
@@ -3108,7 +3108,7 @@
  	return 0;
  }
  
-@@ -532,7 +559,7 @@ static inline int tracehook_allow_access
+@@ -543,7 +570,7 @@ static inline int tracehook_allow_access
   */
  static inline int tracehook_expect_breakpoints(struct task_struct *tsk)
  {
@@ -3117,7 +3117,7 @@
  }
  
  
-@@ -555,6 +582,10 @@ static inline int tracehook_expect_break
+@@ -566,6 +593,10 @@ static inline int tracehook_expect_break
  static inline void tracehook_report_death(struct task_struct *tsk,
  					  int exit_state, void *death_cookie)
  {
@@ -3128,7 +3128,7 @@
  }
  
  /*
-@@ -564,14 +595,18 @@ static inline void tracehook_report_deat
+@@ -575,14 +606,18 @@ static inline void tracehook_report_deat
   */
  static inline void tracehook_report_delayed_group_leader(struct task_struct *p)
  {
@@ -3148,7 +3148,7 @@
  }
  
  /*
-@@ -580,6 +615,8 @@ static inline void tracehook_report_exec
+@@ -591,6 +626,8 @@ static inline void tracehook_report_exec
   */
  static inline void tracehook_report_exit(long *exit_code)
  {
@@ -3157,7 +3157,7 @@
  }
  
  /*
-@@ -594,6 +631,8 @@ static inline void tracehook_report_exit
+@@ -605,6 +642,8 @@ static inline void tracehook_report_exit
  static inline void tracehook_report_clone(unsigned long clone_flags,
  					  struct task_struct *child)
  {
@@ -3166,7 +3166,7 @@
  }
  
  /*
-@@ -607,6 +646,8 @@ static inline void tracehook_report_clon
+@@ -618,6 +657,8 @@ static inline void tracehook_report_clon
  						   pid_t pid,
  						   struct task_struct *child)
  {
@@ -3175,7 +3175,7 @@
  }
  
  /*
-@@ -618,6 +659,8 @@ static inline void tracehook_report_clon
+@@ -629,6 +670,8 @@ static inline void tracehook_report_clon
  static inline void tracehook_report_vfork_done(struct task_struct *child,
  					       pid_t child_pid)
  {
@@ -3184,7 +3184,7 @@
  }
  
  /*
-@@ -625,6 +668,9 @@ static inline void tracehook_report_vfor
+@@ -636,6 +679,9 @@ static inline void tracehook_report_vfor
   */
  static inline void tracehook_report_syscall(struct pt_regs *regs, int is_exit)
  {
@@ -3194,7 +3194,7 @@
  }
  
  /*
-@@ -644,6 +690,11 @@ static inline void tracehook_report_hand
+@@ -655,6 +701,11 @@ static inline void tracehook_report_hand
  						  const sigset_t *oldset,
  						  struct pt_regs *regs)
  {
@@ -3755,7 +3755,7 @@
 +#endif	/* linux/utrace.h */
 --- linux-2.6/include/linux/sched.h
 +++ linux-2.6/include/linux/sched.h
-@@ -1078,6 +1078,11 @@ struct task_struct {
+@@ -1080,6 +1080,11 @@ struct task_struct {
  	struct audit_context *audit_context;
  	seccomp_t seccomp;
  
@@ -3769,7 +3769,7 @@
     	u32 self_exec_id;
 --- linux-2.6/init/Kconfig
 +++ linux-2.6/init/Kconfig
-@@ -675,4 +675,24 @@ config STOP_MACHINE
+@@ -666,4 +666,24 @@ config STOP_MACHINE
  	help
  	  Need stop_machine() primitive.
  

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

Index: linux-2.6-utrace-ptrace-compat-avr32.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-ptrace-compat-avr32.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-utrace-ptrace-compat-avr32.patch	20 Jul 2007 19:52:27 -0000	1.2
+++ linux-2.6-utrace-ptrace-compat-avr32.patch	21 Aug 2007 19:42:55 -0000	1.3
@@ -17,7 +17,7 @@
 
 --- linux-2.6/arch/avr32/kernel/ptrace.c
 +++ linux-2.6/arch/avr32/kernel/ptrace.c
-@@ -78,106 +78,44 @@ const struct utrace_regset_view *utrace_
+@@ -79,106 +79,44 @@ const struct utrace_regset_view *utrace_
  }
  #endif /* CONFIG_UTRACE */
  

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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-utrace-ptrace-compat-ia64.patch	31 Jul 2007 18:25:55 -0000	1.2
+++ linux-2.6-utrace-ptrace-compat-ia64.patch	21 Aug 2007 19:42:55 -0000	1.3
@@ -9,12 +9,12 @@
 ---
 
  arch/ia64/ia32/sys_ia32.c |   40 ++
- arch/ia64/kernel/ptrace.c | 1016 +++++----------------------------------------
- 2 files changed, 159 insertions(+), 897 deletions(-)
+ arch/ia64/kernel/ptrace.c | 1020 +++++----------------------------------------
+ 2 files changed, 159 insertions(+), 901 deletions(-)
 
 --- linux-2.6/arch/ia64/ia32/sys_ia32.c
 +++ linux-2.6/arch/ia64/ia32/sys_ia32.c
-@@ -2341,6 +2341,46 @@ const struct utrace_regset_view utrace_i
+@@ -2344,6 +2344,46 @@ const struct utrace_regset_view utrace_i
  };
  #endif
  
@@ -145,7 +145,7 @@
  /*
   * Write f32-f127 back to task->thread.fph if it has been modified.
   */
-@@ -792,828 +717,6 @@ access_nat_bits (struct task_struct *chi
+@@ -792,832 +717,6 @@ access_nat_bits (struct task_struct *chi
  	return 0;
  }
  
@@ -320,10 +320,14 @@
 -			return 0;
 -
 -		      case PT_CR_IPSR:
--			if (write_access)
--				pt->cr_ipsr = ((*data & IPSR_MASK)
+-			if (write_access) {
+-				unsigned long tmp = *data;
+-				/* psr.ri==3 is a reserved value: SDM 2:25 */
+-				if ((tmp & IA64_PSR_RI) == IA64_PSR_RI)
+-					tmp &= ~IA64_PSR_RI;
+-				pt->cr_ipsr = ((tmp & IPSR_MASK)
 -					       | (pt->cr_ipsr & ~IPSR_MASK));
--			else
+-			} else
 -				*data = (pt->cr_ipsr & IPSR_MASK);
 -			return 0;
 -
@@ -974,7 +978,7 @@
  
  /* "asmlinkage" so the input arguments are preserved... */
  
-@@ -1667,6 +770,9 @@ syscall_trace_leave (long arg0, long arg
+@@ -1671,6 +770,9 @@ syscall_trace_leave (long arg0, long arg
  	}
  }
  
@@ -984,7 +988,7 @@
  /* Utrace implementation starts here */
  
  typedef struct utrace_get {
-@@ -2454,3 +1560,119 @@ const struct utrace_regset_view *utrace_
+@@ -2464,3 +1566,119 @@ const struct utrace_regset_view *utrace_
  #endif
  	return &utrace_ia64_native;
  }

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

Index: linux-2.6-utrace-ptrace-compat-s390.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-ptrace-compat-s390.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-utrace-ptrace-compat-s390.patch	12 Jul 2007 19:40:19 -0000	1.1
+++ linux-2.6-utrace-ptrace-compat-s390.patch	21 Aug 2007 19:42:55 -0000	1.2
@@ -13,7 +13,7 @@
 
 --- linux-2.6/arch/s390/kernel/ptrace.c
 +++ linux-2.6/arch/s390/kernel/ptrace.c
-@@ -575,6 +575,157 @@ const struct utrace_regset_view *utrace_
+@@ -580,6 +580,157 @@ const struct utrace_regset_view *utrace_
  }
  
  

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

Index: linux-2.6-utrace-ptrace-compat-sparc64.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-ptrace-compat-sparc64.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-utrace-ptrace-compat-sparc64.patch	12 Jul 2007 19:40:19 -0000	1.1
+++ linux-2.6-utrace-ptrace-compat-sparc64.patch	21 Aug 2007 19:42:55 -0000	1.2
@@ -12,7 +12,7 @@
 
 --- linux-2.6/arch/sparc64/kernel/ptrace.c
 +++ linux-2.6/arch/sparc64/kernel/ptrace.c
-@@ -667,484 +667,118 @@ void flush_ptrace_access(struct vm_area_
+@@ -671,484 +671,118 @@ void flush_ptrace_access(struct vm_area_
  	}
  }
  

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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- linux-2.6-utrace-ptrace-compat.patch	31 Jul 2007 18:25:55 -0000	1.3
+++ linux-2.6-utrace-ptrace-compat.patch	21 Aug 2007 19:42:55 -0000	1.4
@@ -86,7 +86,7 @@
  	struct task_struct *task = get_proc_task(inode);
 --- linux-2.6/arch/i386/kernel/ptrace.c
 +++ linux-2.6/arch/i386/kernel/ptrace.c
-@@ -743,6 +743,46 @@ const struct utrace_regset_view *utrace_
+@@ -747,6 +747,46 @@ const struct utrace_regset_view *utrace_
  	return &utrace_i386_native;
  }
  
@@ -147,7 +147,7 @@
  static int
  ia32_genregs_get(struct task_struct *target,
  		 const struct utrace_regset *regset,
-@@ -601,3 +596,54 @@ const struct utrace_regset_view utrace_i
+@@ -604,3 +599,54 @@ const struct utrace_regset_view utrace_i
  	.name = "i386", .e_machine = EM_386,
  	.regsets = ia32_regsets, .n = ARRAY_SIZE(ia32_regsets)
  };
@@ -215,7 +215,7 @@
  	.quad sys_pause
 --- linux-2.6/arch/x86_64/kernel/ptrace.c
 +++ linux-2.6/arch/x86_64/kernel/ptrace.c
-@@ -723,6 +723,52 @@ const struct utrace_regset_view *utrace_
+@@ -726,6 +726,52 @@ const struct utrace_regset_view *utrace_
  }
  
  
@@ -270,7 +270,7 @@
  	/* do the secure computing check first */
 --- linux-2.6/arch/powerpc/kernel/ptrace.c
 +++ linux-2.6/arch/powerpc/kernel/ptrace.c
-@@ -559,249 +559,315 @@ const struct utrace_regset_view *utrace_
+@@ -564,249 +564,315 @@ const struct utrace_regset_view *utrace_
  }
  
  
@@ -1302,7 +1302,7 @@
  #include <linux/profile.h>
  #include <linux/signalfd.h>
  #include <linux/mount.h>
-@@ -894,6 +895,8 @@ fastcall NORET_TYPE void do_exit(long co
+@@ -892,6 +893,8 @@ fastcall NORET_TYPE void do_exit(long co
  	tsk->flags |= PF_EXITING;
  	spin_unlock_irq(&tsk->pi_lock);
  
@@ -1311,7 +1311,7 @@
  	if (unlikely(in_atomic()))
  		printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",
  				current->comm, current->pid,
-@@ -1521,9 +1524,15 @@ check_continued:
+@@ -1519,9 +1522,15 @@ check_continued:
  				break;
  			}
  		}
@@ -3503,7 +3503,7 @@
  # According to Alan Modra <alan at linuxcare.com.au>, the -fno-omit-frame-pointer is
 --- linux-2.6/include/linux/sched.h
 +++ linux-2.6/include/linux/sched.h
-@@ -1176,6 +1176,10 @@ struct task_struct {
+@@ -1178,6 +1178,10 @@ struct task_struct {
  	atomic_t fs_excl;	/* holding fs exclusive resources */
  	struct rcu_head rcu;
  
@@ -3772,7 +3772,7 @@
  #endif
 --- linux-2.6/init/Kconfig
 +++ linux-2.6/init/Kconfig
-@@ -681,10 +681,21 @@ endmenu
+@@ -672,10 +672,21 @@ endmenu
  
  menu "Process debugging support"
  

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

Index: linux-2.6-utrace-regset-avr32.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-regset-avr32.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-utrace-regset-avr32.patch	20 Jul 2007 19:52:27 -0000	1.2
+++ linux-2.6-utrace-regset-avr32.patch	21 Aug 2007 19:42:55 -0000	1.3
@@ -10,12 +10,12 @@
 
 ---
 
- arch/avr32/kernel/ptrace.c |  108 ++++++++++++++++++--------------------------
- 1 files changed, 43 insertions(+), 65 deletions(-)
+ arch/avr32/kernel/ptrace.c |  109 ++++++++++++++++++--------------------------
+ 1 files changed, 44 insertions(+), 65 deletions(-)
 
 --- linux-2.6/arch/avr32/kernel/ptrace.c
 +++ linux-2.6/arch/avr32/kernel/ptrace.c
-@@ -14,94 +14,72 @@
+@@ -14,94 +14,73 @@
  #include <linux/ptrace.h>
  #include <linux/errno.h>
  #include <linux/user.h>
@@ -104,6 +104,7 @@
 -	struct pt_regs *regs = get_user_regs(tsk);
 +static const struct utrace_regset native_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.n	= ELF_NGREG,
 +		.size	= sizeof(long),
 +		.align	= sizeof(long),

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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-utrace-regset-ia64.patch	31 Jul 2007 18:25:55 -0000	1.2
+++ linux-2.6-utrace-regset-ia64.patch	21 Aug 2007 19:42:55 -0000	1.3
@@ -9,15 +9,15 @@
 
 ---
 
- arch/ia64/ia32/sys_ia32.c    |  472 +++++++++++++++++++++++++
- arch/ia64/kernel/ptrace.c    |  804 ++++++++++++++++++++++++++++++++++++++++++
+ arch/ia64/ia32/sys_ia32.c    |  476 +++++++++++++++++++++++++
+ arch/ia64/kernel/ptrace.c    |  810 ++++++++++++++++++++++++++++++++++++++++++
  include/asm-ia64/tracehook.h |    7 
  include/asm-ia64/elf.h       |   24 +
- 4 files changed, 1305 insertions(+), 2 deletions(-)
+ 4 files changed, 1315 insertions(+), 2 deletions(-)
 
 --- linux-2.6/arch/ia64/ia32/sys_ia32.c
 +++ linux-2.6/arch/ia64/ia32/sys_ia32.c
-@@ -44,6 +44,7 @@
+@@ -43,6 +43,7 @@
  #include <linux/eventpoll.h>
  #include <linux/personality.h>
  #include <linux/ptrace.h>
@@ -25,7 +25,15 @@
  #include <linux/stat.h>
  #include <linux/ipc.h>
  #include <linux/capability.h>
-@@ -1869,6 +1870,477 @@ sys32_ptrace (int request, pid_t pid, un
+@@ -50,6 +51,7 @@
+ #include <linux/vfs.h>
+ #include <linux/mman.h>
+ #include <linux/mutex.h>
++#include <linux/elf.h>
+ 
+ #include <asm/intrinsics.h>
+ #include <asm/types.h>
+@@ -1868,6 +1870,480 @@ sys32_ptrace (int request, pid_t pid, un
  }
  #endif
  
@@ -478,16 +486,19 @@
 + */
 +static const struct utrace_regset ia32_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.n = sizeof(struct user_regs_struct32)/4,
 +		.size = 4, .align = 4,
 +		.get = ia32_genregs_get, .set = ia32_genregs_set
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.n = sizeof(struct ia32_user_i387_struct) / 4,
 +		.size = 4, .align = 4,
 +		.get = ia32_fpregs_get, .set = ia32_fpregs_set
 +	},
 +	{
++		.core_note_type = NT_PRXFPREG,
 +		.n = sizeof(struct ia32_user_fxsr_struct) / 4,
 +		.size = 4, .align = 4,
 +		.get = ia32_fpxregs_get, .set = ia32_fpxregs_set
@@ -515,23 +526,17 @@
   *
   * Derived from the x86 and Alpha versions.
   */
-@@ -18,13 +21,16 @@
+@@ -18,7 +21,10 @@
  #include <linux/security.h>
  #include <linux/audit.h>
  #include <linux/signal.h>
 +#include <linux/module.h>
++#include <linux/elf.h>
  
 +#include <asm/tracehook.h>
  #include <asm/pgtable.h>
  #include <asm/processor.h>
  #include <asm/ptrace_offsets.h>
- #include <asm/rse.h>
- #include <asm/system.h>
- #include <asm/uaccess.h>
-+#include <asm/elf.h>
- #include <asm/unwind.h>
- #ifdef CONFIG_PERFMON
- #include <asm/perfmon.h>
 @@ -548,6 +554,7 @@ ia64_sync_user_rbs (struct task_struct *
  	return 0;
  }
@@ -572,7 +577,7 @@
  static int
  access_uarea (struct task_struct *child, unsigned long addr,
  	      unsigned long *data, int write_access)
-@@ -1248,7 +1259,9 @@ ptrace_getregs (struct task_struct *chil
+@@ -1252,7 +1263,9 @@ ptrace_getregs (struct task_struct *chil
  	ret = retval ? -EIO : 0;
  	return ret;
  }
@@ -582,7 +587,7 @@
  static long
  ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr)
  {
-@@ -1394,6 +1407,7 @@ ptrace_setregs (struct task_struct *chil
+@@ -1398,6 +1411,7 @@ ptrace_setregs (struct task_struct *chil
  	ret = retval ? -EIO : 0;
  	return ret;
  }
@@ -590,7 +595,7 @@
  
  /*
   * Called by kernel/ptrace.c when detaching..
-@@ -1411,6 +1425,7 @@ ptrace_disable (struct task_struct *chil
+@@ -1415,6 +1429,7 @@ ptrace_disable (struct task_struct *chil
  	child_psr->tb = 0;
  }
  
@@ -598,7 +603,7 @@
  asmlinkage long
  sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data)
  {
-@@ -1598,6 +1613,7 @@ sys_ptrace (long request, pid_t pid, uns
+@@ -1602,6 +1617,7 @@ sys_ptrace (long request, pid_t pid, uns
  	unlock_kernel();
  	return ret;
  }
@@ -606,7 +611,7 @@
  
  /* "asmlinkage" so the input arguments are preserved... */
  
-@@ -1650,3 +1666,791 @@ syscall_trace_leave (long arg0, long arg
+@@ -1654,3 +1670,797 @@ syscall_trace_leave (long arg0, long arg
  		tracehook_report_syscall_step(&regs);
  	}
  }
@@ -646,35 +651,35 @@
 +
 +	pt = task_pt_regs(target);
 +	switch (addr) {
-+		case ELF_GR_OFFSET(1):
-+			ptr = &pt->r1;
-+			break;
-+		case ELF_GR_OFFSET(2):
-+		case ELF_GR_OFFSET(3):
-+			ptr = (void *)&pt->r2 + (addr - ELF_GR_OFFSET(2));
-+			break;
-+		case ELF_GR_OFFSET(4) ... ELF_GR_OFFSET(7):
-+			if (write_access) {
-+				/* read NaT bit first: */
-+				unsigned long dummy;
-+
-+				ret = unw_get_gr(info, addr/8, &dummy, &nat);
-+				if (ret < 0)
-+					return ret;
-+			}
-+			return unw_access_gr(info, addr/8, data, &nat, write_access);
-+		case ELF_GR_OFFSET(8) ... ELF_GR_OFFSET(11):
-+			ptr = (void *)&pt->r8 + addr - ELF_GR_OFFSET(8);
-+			break;
-+		case ELF_GR_OFFSET(12):
-+		case ELF_GR_OFFSET(13):
-+			ptr = (void *)&pt->r12 + addr - ELF_GR_OFFSET(12);
-+			break;
-+		case ELF_GR_OFFSET(14):
-+			ptr = &pt->r14;
-+			break;
-+		case ELF_GR_OFFSET(15):
-+			ptr = &pt->r15;
++	case ELF_GR_OFFSET(1):
++		ptr = &pt->r1;
++		break;
++	case ELF_GR_OFFSET(2):
++	case ELF_GR_OFFSET(3):
++		ptr = (void *)&pt->r2 + (addr - ELF_GR_OFFSET(2));
++		break;
++	case ELF_GR_OFFSET(4) ... ELF_GR_OFFSET(7):
++		if (write_access) {
++			/* read NaT bit first: */
++			unsigned long dummy;
++
++			ret = unw_get_gr(info, addr/8, &dummy, &nat);
++			if (ret < 0)
++				return ret;
++		}
++		return unw_access_gr(info, addr/8, data, &nat, write_access);
++	case ELF_GR_OFFSET(8) ... ELF_GR_OFFSET(11):
++		ptr = (void *)&pt->r8 + addr - ELF_GR_OFFSET(8);
++		break;
++	case ELF_GR_OFFSET(12):
++	case ELF_GR_OFFSET(13):
++		ptr = (void *)&pt->r12 + addr - ELF_GR_OFFSET(12);
++		break;
++	case ELF_GR_OFFSET(14):
++		ptr = &pt->r14;
++		break;
++	case ELF_GR_OFFSET(15):
++		ptr = &pt->r15;
 +	}
 +	if (write_access)
 +		*ptr = *data;
@@ -692,17 +697,17 @@
 +
 +	pt = task_pt_regs(target);
 +	switch (addr) {
-+		case ELF_BR_OFFSET(0):
-+			ptr = &pt->b0;
-+			break;
-+		case ELF_BR_OFFSET(1) ... ELF_BR_OFFSET(5):
-+			return unw_access_br(info, (addr - ELF_BR_OFFSET(0))/8,
-+					data, write_access);
-+		case ELF_BR_OFFSET(6):
-+			ptr = &pt->b6;
-+			break;
-+		case ELF_BR_OFFSET(7):
-+			ptr = &pt->b7;
++	case ELF_BR_OFFSET(0):
++		ptr = &pt->b0;
++		break;
++	case ELF_BR_OFFSET(1) ... ELF_BR_OFFSET(5):
++		return unw_access_br(info, (addr - ELF_BR_OFFSET(0))/8,
++				     data, write_access);
++	case ELF_BR_OFFSET(6):
++		ptr = &pt->b6;
++		break;
++	case ELF_BR_OFFSET(7):
++		ptr = &pt->b7;
 +	}
 +	if (write_access)
 +		*ptr = *data;
@@ -722,137 +727,141 @@
 +	pt = task_pt_regs(target);
 +	if (addr >= ELF_AR_RSC_OFFSET && addr <= ELF_AR_SSD_OFFSET) {
 +		switch (addr) {
-+			case ELF_AR_RSC_OFFSET:
-+				/* force PL3 */
-+				if (write_access)
-+					pt->ar_rsc = *data | (3 << 2);
-+				else
-+					*data = pt->ar_rsc;
-+				return 0;
-+			case ELF_AR_BSP_OFFSET:
-+				/*
-+				 * By convention, we use PT_AR_BSP to refer to
-+				 * the end of the user-level backing store.
-+				 * Use ia64_rse_skip_regs(PT_AR_BSP, -CFM.sof)
-+				 * to get the real value of ar.bsp at the time
-+				 * the kernel was entered.
-+				 *
-+				 * Furthermore, when changing the contents of
-+				 * PT_AR_BSP (or PT_CFM) we MUST copy any
-+				 * users-level stacked registers that are
-+				 * stored on the kernel stack back to
-+				 * user-space because otherwise, we might end
-+				 * up clobbering kernel stacked registers.
-+				 * Also, if this happens while the task is
-+				 * blocked in a system call, which convert the
-+				 * state such that the non-system-call exit
-+				 * path is used.  This ensures that the proper
-+				 * state will be picked up when resuming
-+				 * execution.  However, it *also* means that
-+				 * once we write PT_AR_BSP/PT_CFM, it won't be
-+				 * possible to modify the syscall arguments of
-+				 * the pending system call any longer.  This
-+				 * shouldn't be an issue because modifying
-+				 * PT_AR_BSP/PT_CFM generally implies that
-+				 * we're either abandoning the pending system
-+				 * call or that we defer it's re-execution
-+				 * (e.g., due to GDB doing an inferior
-+				 * function call).
-+				 */
-+				urbs_end = ia64_get_user_rbs_end(target, pt, &cfm);
-+				if (write_access) {
-+					if (*data != urbs_end) {
-+						if (ia64_sync_user_rbs(target, info->sw,
-+									pt->ar_bspstore,
-+									urbs_end) < 0)
-+							return -1;
-+						if (in_syscall(pt))
-+							convert_to_non_syscall(target,
-+									pt,
-+									cfm);
-+						/*
-+						 * Simulate user-level write
-+						 * of ar.bsp:
-+						 */
-+						pt->loadrs = 0;
-+						pt->ar_bspstore = *data;
-+					}
-+				} else
-+					*data = urbs_end;
-+				return 0;
-+			case ELF_AR_BSPSTORE_OFFSET: // ar_bsp_store
-+				ptr = &pt->ar_bspstore;
-+				break;
-+			case ELF_AR_RNAT_OFFSET:  // ar_rnat
-+				urbs_end = ia64_get_user_rbs_end(target, pt, NULL);
-+				rnat_addr = (long) ia64_rse_rnat_addr((long *)
-+						urbs_end);
-+				if (write_access)
-+					return ia64_poke(target, info->sw, urbs_end,
-+							rnat_addr, *data);
-+				else
-+					return ia64_peek(target, info->sw, urbs_end,
-+							rnat_addr, data);
-+			case ELF_AR_CCV_OFFSET:   // ar_ccv
-+				ptr = &pt->ar_ccv;
-+				break;
-+			case ELF_AR_UNAT_OFFSET:	// ar_unat
-+				ptr = &pt->ar_unat;
-+				break;
-+			case ELF_AR_FPSR_OFFSET:  // ar_fpsr
-+				ptr = &pt->ar_fpsr;
-+				break;
-+			case ELF_AR_PFS_OFFSET:  // ar_pfs
-+				ptr = &pt->ar_pfs;
-+				break;
-+			case ELF_AR_LC_OFFSET:   // ar_lc
-+				return unw_access_ar(info, UNW_AR_LC, data,
-+						write_access);
-+			case ELF_AR_EC_OFFSET:    // ar_ec
-+				return unw_access_ar(info, UNW_AR_EC, data,
-+						write_access);
-+			case ELF_AR_CSD_OFFSET:   // ar_csd
-+				ptr = &pt->ar_csd;
-+				break;
-+			case ELF_AR_SSD_OFFSET:   // ar_ssd
-+				ptr = &pt->ar_ssd;
++		case ELF_AR_RSC_OFFSET:
++			/* force PL3 */
++			if (write_access)
++				pt->ar_rsc = *data | (3 << 2);
++			else
++				*data = pt->ar_rsc;
++			return 0;
++		case ELF_AR_BSP_OFFSET:
++			/*
++			 * By convention, we use PT_AR_BSP to refer to
++			 * the end of the user-level backing store.
++			 * Use ia64_rse_skip_regs(PT_AR_BSP, -CFM.sof)
++			 * to get the real value of ar.bsp at the time
++			 * the kernel was entered.
++			 *
++			 * Furthermore, when changing the contents of
++			 * PT_AR_BSP (or PT_CFM) we MUST copy any
++			 * users-level stacked registers that are
++			 * stored on the kernel stack back to
++			 * user-space because otherwise, we might end
++			 * up clobbering kernel stacked registers.
++			 * Also, if this happens while the task is
++			 * blocked in a system call, which convert the
++			 * state such that the non-system-call exit
++			 * path is used.  This ensures that the proper
++			 * state will be picked up when resuming
++			 * execution.  However, it *also* means that
++			 * once we write PT_AR_BSP/PT_CFM, it won't be
++			 * possible to modify the syscall arguments of
++			 * the pending system call any longer.  This
++			 * shouldn't be an issue because modifying
++			 * PT_AR_BSP/PT_CFM generally implies that
++			 * we're either abandoning the pending system
++			 * call or that we defer it's re-execution
++			 * (e.g., due to GDB doing an inferior
++			 * function call).
++			 */
++			urbs_end = ia64_get_user_rbs_end(target, pt, &cfm);
++			if (write_access) {
++				if (*data != urbs_end) {
++					if (ia64_sync_user_rbs(target, info->sw,
++							       pt->ar_bspstore,
++							       urbs_end) < 0)
++						return -1;
++					if (in_syscall(pt))
++						convert_to_non_syscall(target,
++								       pt,
++								       cfm);
++					/*
++					 * Simulate user-level write
++					 * of ar.bsp:
++					 */
++					pt->loadrs = 0;
++					pt->ar_bspstore = *data;
++				}
++			} else
++				*data = urbs_end;
++			return 0;
++		case ELF_AR_BSPSTORE_OFFSET: // ar_bsp_store
++			ptr = &pt->ar_bspstore;
++			break;
++		case ELF_AR_RNAT_OFFSET:  // ar_rnat
++			urbs_end = ia64_get_user_rbs_end(target, pt, NULL);
++			rnat_addr = (long) ia64_rse_rnat_addr((long *)
++							      urbs_end);
++			if (write_access)
++				return ia64_poke(target, info->sw, urbs_end,
++						 rnat_addr, *data);
++			else
++				return ia64_peek(target, info->sw, urbs_end,
++						 rnat_addr, data);
++		case ELF_AR_CCV_OFFSET:   // ar_ccv
++			ptr = &pt->ar_ccv;
++			break;
++		case ELF_AR_UNAT_OFFSET:	// ar_unat
++			ptr = &pt->ar_unat;
++			break;
++		case ELF_AR_FPSR_OFFSET:  // ar_fpsr
++			ptr = &pt->ar_fpsr;
++			break;
++		case ELF_AR_PFS_OFFSET:  // ar_pfs
++			ptr = &pt->ar_pfs;
++			break;
++		case ELF_AR_LC_OFFSET:   // ar_lc
++			return unw_access_ar(info, UNW_AR_LC, data,
++					     write_access);
++		case ELF_AR_EC_OFFSET:    // ar_ec
++			return unw_access_ar(info, UNW_AR_EC, data,
++					     write_access);
++		case ELF_AR_CSD_OFFSET:   // ar_csd
++			ptr = &pt->ar_csd;
++			break;
++		case ELF_AR_SSD_OFFSET:   // ar_ssd
++			ptr = &pt->ar_ssd;
 +		}
 +	} else if (addr >= ELF_CR_IIP_OFFSET && addr <= ELF_CR_IPSR_OFFSET) {
 +		switch (addr) {
-+			case ELF_CR_IIP_OFFSET:
-+				ptr = &pt->cr_iip;
-+				break;
-+			case ELF_CFM_OFFSET:
-+				urbs_end = ia64_get_user_rbs_end(target, pt, &cfm);
-+				if (write_access) {
-+					if (((cfm ^ *data) & PFM_MASK) != 0) {
-+						if (ia64_sync_user_rbs(target, info->sw,
-+									pt->ar_bspstore,
-+									urbs_end) < 0)
-+							return -1;
-+						if (in_syscall(pt))
-+							convert_to_non_syscall(target,
-+									pt,
-+									cfm);
-+						pt->cr_ifs = ((pt->cr_ifs & ~PFM_MASK)
-+								| (*data & PFM_MASK));
-+					}
-+				} else
-+					*data = cfm;
-+				return 0;
-+			case ELF_CR_IPSR_OFFSET:
-+				if (write_access)
-+					pt->cr_ipsr = ((*data & IPSR_MASK)
-+							| (pt->cr_ipsr & ~IPSR_MASK));
-+				else
-+					*data = (pt->cr_ipsr & IPSR_MASK);
-+				return 0;
++		case ELF_CR_IIP_OFFSET:
++			ptr = &pt->cr_iip;
++			break;
++		case ELF_CFM_OFFSET:
++			urbs_end = ia64_get_user_rbs_end(target, pt, &cfm);
++			if (write_access) {
++				if (((cfm ^ *data) & PFM_MASK) != 0) {
++					if (ia64_sync_user_rbs(target, info->sw,
++							       pt->ar_bspstore,
++							       urbs_end) < 0)
++						return -1;
++					if (in_syscall(pt))
++						convert_to_non_syscall(target,
++								       pt,
++								       cfm);
++					pt->cr_ifs = ((pt->cr_ifs & ~PFM_MASK)
++						      | (*data & PFM_MASK));
++				}
++			} else
++				*data = cfm;
++			return 0;
++		case ELF_CR_IPSR_OFFSET:
++			if (write_access) {
++				unsigned long tmp = *data;
++				/* psr.ri==3 is a reserved value: SDM 2:25 */
++				if ((tmp & IA64_PSR_RI) == IA64_PSR_RI)
++					tmp &= ~IA64_PSR_RI;
++				pt->cr_ipsr = ((tmp & IPSR_MASK)
++					       | (pt->cr_ipsr & ~IPSR_MASK));
++			} else
++				*data = (pt->cr_ipsr & IPSR_MASK);
++			return 0;
 +		}
 +	} else if (addr == ELF_NAT_OFFSET)
-+			return access_nat_bits(target, pt, info,
-+					data, write_access);
++		return access_nat_bits(target, pt, info,
++				       data, write_access);
 +	else if (addr == ELF_PR_OFFSET)
-+			ptr = &pt->pr;
++		ptr = &pt->pr;
 +	else
 +		return -1;
 +
@@ -1366,12 +1375,14 @@
 +
 +static const struct utrace_regset native_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.n = ELF_NGREG,
 +		.size = sizeof(elf_greg_t), .align = sizeof(elf_greg_t),
 +		.get = gpregs_get, .set = gpregs_set,
 +		.writeback = gpregs_writeback
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.n = ELF_NFPREG,
 +		.size = sizeof(elf_fpreg_t), .align = sizeof(elf_fpreg_t),
 +		.get = fpregs_get, .set = fpregs_set, .active = fpregs_active

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

Index: linux-2.6-utrace-regset-s390.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-regset-s390.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-utrace-regset-s390.patch	20 Jul 2007 19:52:27 -0000	1.2
+++ linux-2.6-utrace-regset-s390.patch	21 Aug 2007 19:42:55 -0000	1.3
@@ -9,8 +9,8 @@
 ---
 
  arch/s390/kernel/Makefile |    2 
- arch/s390/kernel/ptrace.c |  943 ++++++++++++++++++---------------------------
- 2 files changed, 389 insertions(+), 556 deletions(-)
+ arch/s390/kernel/ptrace.c |  948 +++++++++++++++++++--------------------------
+ 2 files changed, 394 insertions(+), 556 deletions(-)
 
 --- linux-2.6/arch/s390/kernel/Makefile
 +++ linux-2.6/arch/s390/kernel/Makefile
@@ -22,7 +22,7 @@
 +CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"'
 --- linux-2.6/arch/s390/kernel/ptrace.c
 +++ linux-2.6/arch/s390/kernel/ptrace.c
-@@ -30,6 +30,7 @@
+@@ -30,10 +30,12 @@
  #include <linux/errno.h>
  #include <linux/ptrace.h>
  #include <linux/tracehook.h>
@@ -30,15 +30,12 @@
  #include <linux/user.h>
  #include <linux/security.h>
  #include <linux/audit.h>
-@@ -42,6 +43,7 @@
- #include <asm/system.h>
- #include <asm/uaccess.h>
- #include <asm/unistd.h>
-+#include <asm/elf.h>
+ #include <linux/signal.h>
++#include <linux/elf.h>
  
- #ifdef CONFIG_COMPAT
- #include "compat_ptrace.h"
-@@ -116,633 +118,462 @@ tracehook_single_step_enabled(struct tas
+ #include <asm/segment.h>
+ #include <asm/page.h>
+@@ -116,633 +118,467 @@ tracehook_single_step_enabled(struct tas
  	return task->thread.per_info.single_step;
  }
  
@@ -466,11 +463,13 @@
 -		return -EIO;
 +static const struct utrace_regset native_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.size = sizeof(long), .align = sizeof(long),
 +		.n = sizeof(s390_regs) / sizeof(long),
 +		.get = genregs_get, .set = genregs_set
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.size = sizeof(long), .align = sizeof(long),
 +		.n = sizeof(s390_fp_regs) / sizeof(long),
 +		.get = fpregs_get, .set = fpregs_set
@@ -991,14 +990,17 @@
  
 +static const struct utrace_regset s390_compat_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.size = sizeof(u32), .align = sizeof(u32),
 +		.n = sizeof(s390_regs) / sizeof(long),
 +		.get = s390_genregs_get, .set = s390_genregs_set
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.size = sizeof(u32), .align = sizeof(u32),
 +		.n = sizeof(s390_fp_regs) / sizeof(u32),
 +		.get = fpregs_get, .set = fpregs_set
++
 +	},
 +	{
 +		.size = sizeof(u32), .align = sizeof(u32),

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

Index: linux-2.6-utrace-regset-sparc64.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace-regset-sparc64.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-utrace-regset-sparc64.patch	20 Jul 2007 21:26:41 -0000	1.2
+++ linux-2.6-utrace-regset-sparc64.patch	21 Aug 2007 19:42:55 -0000	1.3
@@ -9,9 +9,9 @@
 ---
 
  arch/sparc64/kernel/Makefile  |    2 
- arch/sparc64/kernel/ptrace.c  |  631 +++++++++++++++++++++++++++++++++++++----
+ arch/sparc64/kernel/ptrace.c  |  635 +++++++++++++++++++++++++++++++++++++----
  arch/sparc64/kernel/systbls.S |    4 
- 3 files changed, 568 insertions(+), 69 deletions(-)
+ 3 files changed, 572 insertions(+), 69 deletions(-)
 
 --- linux-2.6/arch/sparc64/kernel/Makefile
 +++ linux-2.6/arch/sparc64/kernel/Makefile
@@ -35,7 +35,7 @@
   * Copyright (C) 1997 Jakub Jelinek (jj at sunsite.mff.cuni.cz)
   *
   * Based upon code written by Ross Biro, Linus Torvalds, Bob Manson,
-@@ -11,106 +11,603 @@
+@@ -11,106 +11,607 @@
   */
  
  #include <linux/kernel.h>
@@ -297,11 +297,13 @@
 -pt_succ_return_linux(struct pt_regs *regs, unsigned long value, void __user *addr)
 +static const struct utrace_regset native_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.n = SPARC64_NGREGS,
 +		.size = sizeof(long), .align = sizeof(long),
 +		.get = genregs_get, .set = genregs_set
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.n = SPARC64_NFPREGS,
 +		.size = sizeof(long), .align = sizeof(long),
 +		.get = fpregs_get, .set = fpregs_set
@@ -665,11 +667,13 @@
 +
 +static const struct utrace_regset sparc32_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.n = SPARC32_NGREGS,
 +		.size = sizeof(u32), .align = sizeof(u32),
 +		.get = genregs32_get, .set = genregs32_set
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.n = SPARC32_NFPREGS,
 +		.size = sizeof(u32), .align = sizeof(u32),
 +		.get = fpregs32_get, .set = fpregs32_set

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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- linux-2.6-utrace-regset.patch	31 Jul 2007 18:25:55 -0000	1.3
+++ linux-2.6-utrace-regset.patch	21 Aug 2007 19:42:55 -0000	1.4
@@ -12,19 +12,19 @@
 ---
 
  arch/i386/kernel/i387.c        |  143 ++++---
- arch/i386/kernel/ptrace.c      |  807 +++++++++++++++++++++++-----------------
- arch/x86_64/ia32/ptrace32.c    |  719 +++++++++++++++++++++++-------------
+ arch/i386/kernel/ptrace.c      |  811 +++++++++++++++++++++++-----------------
+ arch/x86_64/ia32/ptrace32.c    |  722 +++++++++++++++++++++++-------------
  arch/x86_64/ia32/fpu32.c       |   92 ++++-
- arch/x86_64/kernel/ptrace.c    |  723 ++++++++++++++++++++++--------------
+ arch/x86_64/kernel/ptrace.c    |  726 ++++++++++++++++++++++--------------
  arch/powerpc/kernel/Makefile   |    2 
  arch/powerpc/kernel/ptrace32.c |   20 -
- arch/powerpc/kernel/ptrace.c   |  612 ++++++++++++++++++++----------
+ arch/powerpc/kernel/ptrace.c   |  617 ++++++++++++++++++++----------
  kernel/ptrace.c                |    8 
- include/linux/tracehook.h      |  244 ++++++++++++
+ 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, 2177 insertions(+), 1217 deletions(-)
+ 13 files changed, 2203 insertions(+), 1217 deletions(-)
 
 --- linux-2.6/arch/i386/kernel/i387.c
 +++ linux-2.6/arch/i386/kernel/i387.c
@@ -239,17 +239,18 @@
  /*
 --- linux-2.6/arch/i386/kernel/ptrace.c
 +++ linux-2.6/arch/i386/kernel/ptrace.c
-@@ -17,7 +17,9 @@
+@@ -17,7 +17,10 @@
  #include <linux/audit.h>
  #include <linux/seccomp.h>
  #include <linux/signal.h>
 +#include <linux/module.h>
++#include <linux/elf.h>
  
 +#include <asm/tracehook.h>
  #include <asm/uaccess.h>
  #include <asm/pgtable.h>
  #include <asm/system.h>
-@@ -28,10 +30,6 @@
+@@ -28,10 +31,6 @@
  #include <asm/desc.h>
  #include <asm/tracehook.h>
  
@@ -260,7 +261,7 @@
  
  /*
   * Determines which flags the user has access to [1 = access, 0 = no access].
-@@ -40,9 +38,6 @@
+@@ -40,9 +39,6 @@
   */
  #define FLAG_MASK 0x00050dd5
  
@@ -270,7 +271,7 @@
  /*
   * Offset of eflags on child stack..
   */
-@@ -90,28 +85,35 @@ static int putreg(struct task_struct *ch
+@@ -90,28 +86,35 @@ static int putreg(struct task_struct *ch
  	unsigned long regno, unsigned long value)
  {
  	switch (regno >> 2) {
@@ -328,7 +329,7 @@
  	}
  	if (regno > FS*4)
  		regno -= 1*4;
-@@ -125,20 +127,28 @@ static unsigned long getreg(struct task_
+@@ -125,20 +128,28 @@ static unsigned long getreg(struct task_
  	unsigned long retval = ~0UL;
  
  	switch (regno >> 2) {
@@ -371,7 +372,7 @@
  	}
  	return retval;
  }
-@@ -238,11 +248,11 @@ void tracehook_enable_single_step(struct
+@@ -238,11 +249,11 @@ void tracehook_enable_single_step(struct
  	/*
  	 * If TF was already set, don't do anything else
  	 */
@@ -385,7 +386,7 @@
  
  	/*
  	 * ..but if TF is changed by the instruction we will trace,
-@@ -263,29 +273,311 @@ void tracehook_disable_single_step(struc
+@@ -263,29 +274,311 @@ void tracehook_disable_single_step(struc
  	/* But touch TF only if it was set by us.. */
  	if (test_and_clear_tsk_thread_flag(child, TIF_FORCED_TF)) {
  		struct pt_regs *regs = get_child_regs(child);
@@ -709,7 +710,7 @@
  
  /*
   * Get the current Thread-Local Storage area:
-@@ -307,23 +599,29 @@ ptrace_get_thread_area(struct task_struc
+@@ -307,23 +600,29 @@ ptrace_get_thread_area(struct task_struc
  #define GET_PRESENT(desc)	(((desc)->b >> 15) & 1)
  #define GET_USEABLE(desc)	(((desc)->b >> 20) & 1)
  
@@ -755,7 +756,7 @@
  
  	return 0;
  }
-@@ -332,293 +630,120 @@ ptrace_get_thread_area(struct task_struc
+@@ -332,293 +631,123 @@ ptrace_get_thread_area(struct task_struc
   * Perform set_thread_area on behalf of the traced child.
   */
  static int
@@ -1094,16 +1095,19 @@
 + */
 +static const struct utrace_regset native_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.n = FRAME_SIZE, .size = sizeof(long), .align = sizeof(long),
 +		.get = genregs_get, .set = genregs_set
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.n = sizeof(struct user_i387_struct) / sizeof(long),
 +		.size = sizeof(long), .align = sizeof(long),
 +		.active = fpregs_active,
 +		.get = fpregs_get, .set = fpregs_set
 +	},
 +	{
++		.core_note_type = NT_PRXFPREG,
 +		.n = sizeof(struct user_fxsr_struct) / sizeof(long),
 +		.size = sizeof(long), .align = sizeof(long),
 +		.active = fpxregs_active,
@@ -1331,7 +1335,7 @@
  		break;
  
  	R32(cs, cs);
-@@ -168,239 +148,456 @@ static int getreg32(struct task_struct *
+@@ -168,239 +148,459 @@ static int getreg32(struct task_struct *
  	R32(eax, rax);
  	R32(orig_eax, orig_rax);
  	R32(eip, rip);
@@ -1943,17 +1947,20 @@
 + */
 +static const struct utrace_regset ia32_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.n = sizeof(struct user_regs_struct32)/4,
 +		.size = 4, .align = 4,
 +		.get = ia32_genregs_get, .set = ia32_genregs_set
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.n = sizeof(struct user_i387_ia32_struct) / 4,
 +		.size = 4, .align = 4,
 +		.active = ia32_fpregs_active,
 +		.get = ia32_fpregs_get, .set = ia32_fpregs_set
 +	},
 +	{
++		.core_note_type = NT_PRXFPREG,
 +		.n = sizeof(struct user32_fxsr_struct) / 4,
 +		.size = 4, .align = 4,
 +		.active = ia32_fpxregs_active,
@@ -2134,17 +2141,18 @@
 +}
 --- linux-2.6/arch/x86_64/kernel/ptrace.c
 +++ linux-2.6/arch/x86_64/kernel/ptrace.c
-@@ -19,7 +19,9 @@
+@@ -19,7 +19,10 @@
  #include <linux/audit.h>
  #include <linux/seccomp.h>
  #include <linux/signal.h>
 +#include <linux/module.h>
++#include <linux/elf.h>
  
 +#include <asm/tracehook.h>
  #include <asm/uaccess.h>
  #include <asm/pgtable.h>
  #include <asm/system.h>
-@@ -30,6 +32,7 @@
+@@ -30,6 +33,7 @@
  #include <asm/desc.h>
  #include <asm/proto.h>
  #include <asm/ia32.h>
@@ -2152,7 +2160,7 @@
  
  /*
   * does not yet catch signals sent when the child dies.
-@@ -237,52 +240,61 @@ static int putreg(struct task_struct *ch
+@@ -237,52 +241,61 @@ static int putreg(struct task_struct *ch
  	if (test_tsk_thread_flag(child, TIF_IA32))
  		value &= 0xffffffff;
  	switch (regno) {
@@ -2260,7 +2268,7 @@
  	}
  	put_stack_long(child, regno - sizeof(struct pt_regs), value);
  	return 0;
-@@ -291,287 +303,426 @@ static int putreg(struct task_struct *ch
+@@ -291,287 +304,428 @@ static int putreg(struct task_struct *ch
  static unsigned long getreg(struct task_struct *child, unsigned long regno)
  {
  	unsigned long val;
@@ -2888,10 +2896,12 @@
 + */
 +static const struct utrace_regset native_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.n = sizeof(struct user_regs_struct)/8, .size = 8, .align = 8,
 +		.get = genregs_get, .set = genregs_set
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.n = sizeof(struct user_i387_struct) / sizeof(long),
 +		.size = sizeof(long), .align = sizeof(long),
 +		.active = fpregs_active,
@@ -3396,7 +3406,7 @@
  	/* The bottom 3 bits are flags */
  	if ((data & ~0x7UL) >= TASK_SIZE)
  		return -EIO;
-@@ -306,18 +324,242 @@ static int ptrace_set_debugreg(struct ta
+@@ -306,17 +324,246 @@ static int ptrace_set_debugreg(struct ta
  	return 0;
  }
  
@@ -3431,14 +3441,15 @@
 - *
 - * Make sure single step bits etc are not set.
 + * These are our native regset flavors.
-  */
--void ptrace_disable(struct task_struct *child)
++ */
 +static const struct utrace_regset native_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.n = ELF_NGREG, .size = sizeof(long), .align = sizeof(long),
 +		.get = genregs_get, .set = genregs_set
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.n = ELF_NFPREG,
 +		.size = sizeof(double), .align = sizeof(double),
 +		.get = fpregs_get, .set = fpregs_set
@@ -3476,9 +3487,7 @@
 +	      const struct utrace_regset *regset,
 +	      unsigned int pos, unsigned int count,
 +	      void *kbuf, void __user *ubuf)
- {
--	/* make sure the single step bit is not set. */
--	tracehook_disable_single_step(child);
++{
 +	unsigned long *regs = (unsigned long *) target->thread.regs;
 +
 +	if (regs == NULL)
@@ -3589,21 +3598,25 @@
 +		ret = set_thread_dabr(target, dabr);
 +
 +	return ret;
- }
- 
- /*
++}
++
++/*
 + * These are the regset flavors matching the CONFIG_PPC32 native set.
-+ */
+  */
+-void ptrace_disable(struct task_struct *child)
 +static const struct utrace_regset ppc32_regsets[] = {
 +	{
++		.core_note_type = NT_PRSTATUS,
 +		.n = ELF_NGREG,
 +		.size = sizeof(compat_long_t), .align = sizeof(compat_long_t),
 +		.get = ppc32_gpr_get, .set = ppc32_gpr_set
 +	},
 +	{
++		.core_note_type = NT_PRFPREG,
 +		.n = ELF_NFPREG,
 +		.size = sizeof(double), .align = sizeof(double),
 +		.get = fpregs_get, .set = fpregs_set
++
 +	},
 +#ifdef CONFIG_ALTIVEC
 +	{
@@ -3632,20 +3645,21 @@
 +#endif	/* CONFIG_PPC64 */
 +
 +const struct utrace_regset_view *utrace_native_view(struct task_struct *tsk)
-+{
+ {
+-	/* make sure the single step bit is not set. */
+-	tracehook_disable_single_step(child);
 +#ifdef CONFIG_PPC64
 +	if (test_tsk_thread_flag(tsk, TIF_32BIT))
 +		return &utrace_ppc32_view;
 +#endif
 +	return &utrace_ppc_native_view;
-+}
-+
+ }
+ 
 +
-+/*
+ /*
   * Here are the old "legacy" powerpc specific getregs/setregs ptrace calls,
   * we mark them as obsolete now, they will be removed in a future version
-  */
-@@ -359,13 +601,13 @@ static long arch_ptrace_old(struct task_
+@@ -359,13 +606,13 @@ static long arch_ptrace_old(struct task_
  
  	case PPC_PTRACE_GETFPREGS: { /* Get FPRs 0 - 31. */
  		flush_fp_to_thread(child);
@@ -3661,7 +3675,7 @@
  		break;
  	}
  
-@@ -402,7 +644,7 @@ long arch_ptrace(struct task_struct *chi
+@@ -402,7 +649,7 @@ long arch_ptrace(struct task_struct *chi
  
  		CHECK_FULL_REGS(child->thread.regs);
  		if (index < PT_FPR0) {
@@ -3670,7 +3684,7 @@
  		} else {
  			flush_fp_to_thread(child);
  			tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0];
-@@ -435,7 +677,7 @@ long arch_ptrace(struct task_struct *chi
+@@ -435,7 +682,7 @@ long arch_ptrace(struct task_struct *chi
  
  		CHECK_FULL_REGS(child->thread.regs);
  		if (index < PT_FPR0) {
@@ -3679,7 +3693,7 @@
  		} else {
  			flush_fp_to_thread(child);
  			((unsigned long *)child->thread.fpr)[index - PT_FPR0] = data;
-@@ -444,52 +686,6 @@ long arch_ptrace(struct task_struct *chi
+@@ -444,52 +691,6 @@ long arch_ptrace(struct task_struct *chi
  		break;
  	}
  
@@ -3732,7 +3746,7 @@
  	case PTRACE_GET_DEBUGREG: {
  		ret = -EINVAL;
  		/* We only support one DABR and no IABRS at the moment */
-@@ -501,7 +697,7 @@ long arch_ptrace(struct task_struct *chi
+@@ -501,7 +702,7 @@ long arch_ptrace(struct task_struct *chi
  	}
  
  	case PTRACE_SET_DEBUGREG:
@@ -3741,7 +3755,7 @@
  		break;
  
  	case PTRACE_DETACH:
-@@ -520,8 +716,8 @@ long arch_ptrace(struct task_struct *chi
+@@ -520,8 +721,8 @@ long arch_ptrace(struct task_struct *chi
  		}
  		ret = 0;
  		for (ui = 0; ui < PT_REGS_COUNT; ui ++) {
@@ -3752,7 +3766,7 @@
  			data += sizeof(long);
  		}
  		break;
-@@ -543,7 +739,7 @@ long arch_ptrace(struct task_struct *chi
+@@ -543,7 +744,7 @@ long arch_ptrace(struct task_struct *chi
  			ret = __get_user(tmp, (unsigned long __user *) data);
  			if (ret)
  				break;
@@ -3761,7 +3775,7 @@
  			data += sizeof(long);
  		}
  		break;
-@@ -551,13 +747,13 @@ long arch_ptrace(struct task_struct *chi
+@@ -551,13 +752,13 @@ long arch_ptrace(struct task_struct *chi
  
  	case PTRACE_GETFPREGS: { /* Get the child FPU state (FPR0...31 + FPSCR) */
  		flush_fp_to_thread(child);
@@ -3777,7 +3791,7 @@
  		break;
  	}
  
-@@ -565,13 +761,13 @@ long arch_ptrace(struct task_struct *chi
+@@ -565,13 +766,13 @@ long arch_ptrace(struct task_struct *chi
  	case PTRACE_GETVRREGS:
  		/* Get the child altivec register state. */
  		flush_altivec_to_thread(child);
@@ -3793,7 +3807,7 @@
  		break;
  #endif
  #ifdef CONFIG_SPE
-@@ -579,7 +775,7 @@ long arch_ptrace(struct task_struct *chi
+@@ -579,7 +780,7 @@ long arch_ptrace(struct task_struct *chi
  		/* Get the child spe register state. */
  		if (child->thread.regs->msr & MSR_SPE)
  			giveup_spe(child);
@@ -3802,7 +3816,7 @@
  		break;
  
  	case PTRACE_SETEVRREGS:
-@@ -588,7 +784,7 @@ long arch_ptrace(struct task_struct *chi
+@@ -588,7 +789,7 @@ long arch_ptrace(struct task_struct *chi
  		 * of register state from memory */
  		if (child->thread.regs->msr & MSR_SPE)
  			giveup_spe(child);
@@ -3856,7 +3870,7 @@
   * Enabling or disabling redundantly is harmless.
   *
   *	void tracehook_enable_block_step(struct task_struct *tsk);
-@@ -93,6 +93,242 @@ struct pt_regs;
+@@ -93,6 +93,253 @@ struct pt_regs;
   */
  
  
@@ -3896,6 +3910,17 @@
 +	unsigned int bias;	/* Bias from natural indexing.  */
 +
 +	/*
++	 * If nonzero, this gives the n_type field (NT_* value) of the
++	 * core file note in which this regset's data appears.
++	 * NT_PRSTATUS is a special case in that the regset data starts
++	 * at offsetof(struct elf_prstatus, pr_reg) into the note data;
++	 * that is part of the per-machine ELF formats userland knows
++	 * about.  In other cases, the core file note contains exactly
++	 * the whole regset (n*size) and nothing else.
++	 */
++	unsigned int core_note_type;
++
++	/*
 +	 * Return -%ENODEV if not available on the hardware found.
 +	 * Return %0 if no interesting state in this thread.
 +	 * Return >%0 number of @size units of interesting state.

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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-utrace-tracehook-ia64.patch	31 Jul 2007 18:25:55 -0000	1.2
+++ linux-2.6-utrace-tracehook-ia64.patch	21 Aug 2007 19:42:55 -0000	1.3
@@ -29,7 +29,7 @@
  	data8 sys32_pause
 --- linux-2.6/arch/ia64/ia32/sys_ia32.c
 +++ linux-2.6/arch/ia64/ia32/sys_ia32.c
-@@ -1437,25 +1437,6 @@ sys32_waitpid (int pid, unsigned int *st
+@@ -1436,25 +1436,6 @@ sys32_waitpid (int pid, unsigned int *st
  	return compat_sys_wait4(pid, stat_addr, options, NULL);
  }
  
@@ -55,7 +55,7 @@
  /*
   *  The order in which registers are stored in the ptrace regs structure
   */
-@@ -1753,6 +1734,7 @@ restore_ia32_fpxstate (struct task_struc
+@@ -1752,6 +1733,7 @@ restore_ia32_fpxstate (struct task_struc
  	return 0;
  }
  
@@ -63,7 +63,7 @@
  asmlinkage long
  sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data)
  {
-@@ -1860,9 +1842,11 @@ sys32_ptrace (int request, pid_t pid, un
+@@ -1859,9 +1841,11 @@ sys32_ptrace (int request, pid_t pid, un
  					    compat_ptr(data));
  		break;
  
@@ -75,7 +75,7 @@
  
  	      case PTRACE_SYSCALL:	/* continue, stop after next syscall */
  	      case PTRACE_CONT:		/* restart after signal. */
-@@ -1883,6 +1867,7 @@ sys32_ptrace (int request, pid_t pid, un
+@@ -1882,6 +1866,7 @@ sys32_ptrace (int request, pid_t pid, un
  	unlock_kernel();
  	return ret;
  }
@@ -93,7 +93,7 @@
  #include <linux/smp_lock.h>
  #include <linux/user.h>
  #include <linux/security.h>
-@@ -1598,28 +1599,6 @@ sys_ptrace (long request, pid_t pid, uns
+@@ -1602,28 +1603,6 @@ sys_ptrace (long request, pid_t pid, uns
  	return ret;
  }
  
@@ -122,7 +122,7 @@
  /* "asmlinkage" so the input arguments are preserved... */
  
  asmlinkage void
-@@ -1627,9 +1606,8 @@ syscall_trace_enter (long arg0, long arg
+@@ -1631,9 +1610,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;
-@@ -1664,8 +1642,11 @@ syscall_trace_leave (long arg0, long arg
+@@ -1668,8 +1646,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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- linux-2.6-utrace-tracehook.patch	31 Jul 2007 18:25:55 -0000	1.6
+++ linux-2.6-utrace-tracehook.patch	21 Aug 2007 19:42:55 -0000	1.7
@@ -65,14 +65,13 @@
  arch/x86_64/mm/fault.c              |    2 
  arch/arm/kernel/ptrace.c            |   17 -
  arch/mips/kernel/sysirix.c          |    2 
- arch/mips/kernel/ptrace.c           |   21 --
+ arch/mips/kernel/ptrace.c           |   23 --
  arch/powerpc/kernel/sys_ppc32.c     |    5 
  arch/powerpc/kernel/ptrace32.c      |    7 +
  arch/powerpc/kernel/ptrace.c        |   49 +---
  arch/powerpc/kernel/signal.c        |    3 
  arch/powerpc/kernel/asm-offsets.c   |    2 
  arch/powerpc/kernel/process.c       |    5 
- arch/arm26/kernel/ptrace.c          |   32 +--
  arch/alpha/kernel/asm-offsets.c     |    2 
  arch/alpha/kernel/entry.S           |    4 
  arch/sparc64/kernel/binfmt_aout32.c |    2 
@@ -82,10 +81,10 @@
  arch/ia64/kernel/mca.c              |    2 
  arch/ia64/kernel/asm-offsets.c      |    2 
  arch/ia64/kernel/fsys.S             |   16 +
- kernel/exit.c                       |  252 ++++++---------------
+ kernel/exit.c                       |  250 ++++++---------------
  kernel/ptrace.c                     |  298 +------------------------
  kernel/timer.c                      |    6 -
- kernel/signal.c                     |  214 ++++--------------
+ kernel/signal.c                     |  210 ++++--------------
  kernel/tsacct.c                     |    2 
  kernel/sys.c                        |    2 
  kernel/fork.c                       |   66 ++----
@@ -101,7 +100,7 @@
  include/asm-x86_64/thread_info.h    |    3 
  drivers/connector/cn_proc.c         |    4 
  mm/nommu.c                          |    4 
- 68 files changed, 913 insertions(+), 1167 deletions(-)
+ 67 files changed, 904 insertions(+), 1140 deletions(-)
  create include/linux/tracehook.h
  create include/asm-i386/tracehook.h
  create include/asm-powerpc/tracehook.h
@@ -258,7 +257,7 @@
  #include <linux/mount.h>
  #include <linux/security.h>
  #include <linux/syscalls.h>
-@@ -1158,13 +1158,7 @@ EXPORT_SYMBOL(prepare_binprm);
+@@ -1161,13 +1161,7 @@ EXPORT_SYMBOL(prepare_binprm);
  
  static int unsafe_exec(struct task_struct *p)
  {
@@ -273,7 +272,7 @@
  	if (atomic_read(&p->fs->count) > 1 ||
  	    atomic_read(&p->files->count) > 1 ||
  	    atomic_read(&p->sighand->count) > 1)
-@@ -1306,6 +1300,7 @@ int search_binary_handler(struct linux_b
+@@ -1311,6 +1305,7 @@ int search_binary_handler(struct linux_b
  				bprm->file = NULL;
  				current->did_exec = 1;
  				proc_exec_connector(current);
@@ -1240,17 +1239,18 @@
  
 --- linux-2.6/arch/mips/kernel/ptrace.c
 +++ linux-2.6/arch/mips/kernel/ptrace.c
-@@ -474,26 +474,9 @@ asmlinkage void do_syscall_trace(struct 
+@@ -478,28 +478,9 @@ asmlinkage void do_syscall_trace(struct 
  		audit_syscall_exit(AUDITSC_RESULT(regs->regs[2]),
  		                   regs->regs[2]);
  
 -	if (!(current->ptrace & PT_PTRACED))
 -		goto out;
--	if (!test_thread_flag(TIF_SYSCALL_TRACE))
--		goto out;
 +	if (test_thread_flag(TIF_SYSCALL_TRACE))
 +		tracehook_report_syscall(regs, entryexit);
  
+-	if (!test_thread_flag(TIF_SYSCALL_TRACE))
+-		goto out;
+-
 -	/* The 0x80 provides a way for the tracing parent to distinguish
 -	   between a syscall stop and SIGTRAP delivery */
 -	ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ?
@@ -1265,9 +1265,10 @@
 -		send_sig(current->exit_code, current, 1);
 -		current->exit_code = 0;
 -	}
-- out:
+-
+-out:
  	if (unlikely(current->audit_context) && !entryexit)
- 		audit_syscall_entry(audit_arch(), regs->regs[2],
+ 		audit_syscall_entry(audit_arch(), regs->regs[0],
  				    regs->regs[4], regs->regs[5],
 --- linux-2.6/arch/powerpc/kernel/sys_ppc32.c
 +++ linux-2.6/arch/powerpc/kernel/sys_ppc32.c
@@ -1497,48 +1498,6 @@
  	putname(filename);
  out:
  	return error;
---- linux-2.6/arch/arm26/kernel/ptrace.c
-+++ linux-2.6/arch/arm26/kernel/ptrace.c
-@@ -641,30 +641,16 @@ asmlinkage void syscall_trace(int why, s
- {
- 	unsigned long ip;
- 
--	if (!test_thread_flag(TIF_SYSCALL_TRACE))
--		return;
--	if (!(current->ptrace & PT_PTRACED))
--		return;
-+	if (test_thread_flag(TIF_SYSCALL_TRACE)) {
-+		/*
-+		 * Save IP.  IP is used to denote syscall entry/exit:
-+		 *  IP = 0 -> entry, = 1 -> exit
-+		 */
-+		ip = regs->ARM_ip;
-+		regs->ARM_ip = why;
- 
--	/*
--	 * Save IP.  IP is used to denote syscall entry/exit:
--	 *  IP = 0 -> entry, = 1 -> exit
--	 */
--	ip = regs->ARM_ip;
--	regs->ARM_ip = why;
-+		tracehook_report_syscall(regs, why);
- 
--	/* the 0x80 provides a way for the tracing parent to distinguish
--	   between a syscall stop and SIGTRAP delivery */
--	ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
--				 ? 0x80 : 0));
--	/*
--	 * this isn't the same as continuing with a signal, but it will do
--	 * for normal use.  strace only continues with a signal if the
--	 * stopping signal is not SIGTRAP.  -brl
--	 */
--	if (current->exit_code) {
--		send_sig(current->exit_code, current, 1);
--		current->exit_code = 0;
-+		regs->ARM_ip = ip;
- 	}
--	regs->ARM_ip = ip;
- }
 --- linux-2.6/arch/alpha/kernel/asm-offsets.c
 +++ linux-2.6/arch/alpha/kernel/asm-offsets.c
 @@ -27,7 +27,7 @@ void foo(void)
@@ -1933,7 +1892,7 @@
  	
  	pgrp = task_pgrp(tsk);
  	if ((task_pgrp(t) != pgrp) &&
-@@ -835,32 +794,18 @@ static void exit_notify(struct task_stru
+@@ -833,30 +792,18 @@ static void exit_notify(struct task_stru
  	    && !capable(CAP_KILL))
  		tsk->exit_signal = SIGCHLD;
  
@@ -1953,9 +1912,7 @@
 +		do_notify_parent(tsk, tsk->exit_signal);
  
  	state = EXIT_ZOMBIE;
--	if (tsk->exit_signal == -1 &&
--	    (likely(tsk->ptrace == 0) ||
--	     unlikely(tsk->parent->signal->flags & SIGNAL_GROUP_EXIT)))
+-	if (tsk->exit_signal == -1 && likely(!tsk->ptrace))
 +	if (tsk->exit_signal == -1 && !noreap)
  		state = EXIT_DEAD;
  	tsk->exit_state = state;
@@ -1971,7 +1928,7 @@
  
  	/* If the process is dead, release it - nobody will wait for it */
  	if (state == EXIT_DEAD)
-@@ -916,10 +861,7 @@ fastcall NORET_TYPE void do_exit(long co
+@@ -912,10 +859,7 @@ fastcall NORET_TYPE void do_exit(long co
  	}
  
  
@@ -1983,7 +1940,7 @@
  
  	/*
  	 * We're taking recursive faults here in do_exit. Safest is to just
-@@ -1116,10 +1058,9 @@ static int eligible_child(pid_t pid, int
+@@ -1112,10 +1056,9 @@ static int eligible_child(pid_t pid, int
  	}
  
  	/*
@@ -1996,7 +1953,7 @@
  		return 0;
  
  	/* Wait for all children (clone and not) if __WALL is set;
-@@ -1191,7 +1132,7 @@ static int wait_task_zombie(struct task_
+@@ -1187,7 +1130,7 @@ static int wait_task_zombie(struct task_
  
  		if (unlikely(p->exit_state != EXIT_ZOMBIE))
  			return 0;
@@ -2005,7 +1962,7 @@
  			return 0;
  		get_task_struct(p);
  		read_unlock(&tasklist_lock);
-@@ -1215,15 +1156,9 @@ static int wait_task_zombie(struct task_
+@@ -1211,15 +1154,9 @@ static int wait_task_zombie(struct task_
  		BUG_ON(state != EXIT_DEAD);
  		return 0;
  	}
@@ -2023,7 +1980,7 @@
  		struct signal_struct *psig;
  		struct signal_struct *sig;
  
-@@ -1311,28 +1246,8 @@ static int wait_task_zombie(struct task_
+@@ -1307,28 +1244,8 @@ static int wait_task_zombie(struct task_
  		return retval;
  	}
  	retval = p->pid;
@@ -2054,7 +2011,7 @@
  	BUG_ON(!retval);
  	return retval;
  }
-@@ -1351,7 +1266,7 @@ static int wait_task_stopped(struct task
+@@ -1347,7 +1264,7 @@ static int wait_task_stopped(struct task
  
  	if (!p->exit_code)
  		return 0;
@@ -2063,7 +2020,7 @@
  	    p->signal && p->signal->group_stop_count > 0)
  		/*
  		 * A group stop is in progress and this is the group leader.
-@@ -1372,14 +1287,13 @@ static int wait_task_stopped(struct task
+@@ -1368,14 +1285,13 @@ static int wait_task_stopped(struct task
  	if (unlikely(noreap)) {
  		pid_t pid = p->pid;
  		uid_t uid = p->uid;
@@ -2080,7 +2037,7 @@
  					   infop, ru);
  	}
  
-@@ -1435,9 +1349,7 @@ bail_ref:
+@@ -1431,9 +1347,7 @@ bail_ref:
  	if (!retval && infop)
  		retval = put_user(0, &infop->si_errno);
  	if (!retval && infop)
@@ -2091,7 +2048,7 @@
  	if (!retval && infop)
  		retval = put_user(exit_code, &infop->si_status);
  	if (!retval && infop)
-@@ -1505,22 +1417,6 @@ static int wait_task_continued(struct ta
+@@ -1501,22 +1415,6 @@ static int wait_task_continued(struct ta
  }
  
  
@@ -2114,7 +2071,7 @@
  static long do_wait(pid_t pid, int options, struct siginfo __user *infop,
  		    int __user *stat_addr, struct rusage __user *ru)
  {
-@@ -1560,26 +1456,17 @@ repeat:
+@@ -1556,26 +1454,17 @@ repeat:
  
  			switch (p->state) {
  			case TASK_TRACED:
@@ -2145,7 +2102,7 @@
  					continue;
  				retval = wait_task_stopped(p, ret == 2,
  							   (options & WNOWAIT),
-@@ -1604,6 +1491,10 @@ repeat:
+@@ -1600,6 +1489,10 @@ repeat:
  						goto check_continued;
  					if (!likely(options & WEXITED))
  						continue;
@@ -2156,7 +2113,7 @@
  					retval = wait_task_zombie(
  						p, (options & WNOWAIT),
  						infop, stat_addr, ru);
-@@ -1620,6 +1511,8 @@ check_continued:
+@@ -1616,6 +1509,8 @@ check_continued:
  				flag = 1;
  				if (!unlikely(options & WCONTINUED))
  					continue;
@@ -2165,7 +2122,7 @@
  				retval = wait_task_continued(
  					p, (options & WNOWAIT),
  					infop, stat_addr, ru);
-@@ -1629,14 +1522,7 @@ check_continued:
+@@ -1625,14 +1520,7 @@ check_continued:
  			}
  		}
  		if (!flag) {
@@ -2181,7 +2138,7 @@
  		}
  		if (options & __WNOTHREAD)
  			break;
-@@ -1663,7 +1549,7 @@ end:
+@@ -1659,7 +1547,7 @@ end:
  	remove_wait_queue(&current->signal->wait_chldexit,&wait);
  	if (infop) {
  		if (retval > 0)
@@ -2721,7 +2678,7 @@
  	sighand = parent->sighand;
  	spin_lock_irqsave(&sighand->siglock, flags);
  	if (sighand->action[SIGCHLD-1].sa.sa_handler != SIG_IGN &&
-@@ -1552,111 +1550,6 @@ static void do_notify_parent_cldstop(str
+@@ -1552,107 +1550,6 @@ static void do_notify_parent_cldstop(str
  	spin_unlock_irqrestore(&sighand->siglock, flags);
  }
  
@@ -2734,10 +2691,6 @@
 -		    (current->ptrace & PT_ATTACHED)))
 -		return 0;
 -
--	if (unlikely(current->signal == current->parent->signal) &&
--	    unlikely(current->signal->flags & SIGNAL_GROUP_EXIT))
--		return 0;
--
 -	/*
 -	 * Are we in the middle of do_coredump?
 -	 * If so and our tracer is also part of the coredump stopping
@@ -2833,7 +2786,7 @@
  static void
  finish_stop(int stop_count)
  {
-@@ -1665,7 +1558,7 @@ finish_stop(int stop_count)
+@@ -1661,7 +1558,7 @@ finish_stop(int stop_count)
  	 * a group stop in progress and we are the last to stop,
  	 * report to the parent.  When ptraced, every thread reports itself.
  	 */
@@ -2842,7 +2795,7 @@
  		read_lock(&tasklist_lock);
  		do_notify_parent_cldstop(current, CLD_STOPPED);
  		read_unlock(&tasklist_lock);
-@@ -1792,44 +1685,24 @@ relock:
+@@ -1788,44 +1685,24 @@ relock:
  		    handle_group_stop())
  			goto relock;
  
@@ -2903,7 +2856,7 @@
  		if (ka->sa.sa_handler == SIG_IGN) /* Do nothing.  */
  			continue;
  		if (ka->sa.sa_handler != SIG_DFL) {
-@@ -1878,7 +1751,7 @@ relock:
+@@ -1874,7 +1751,7 @@ relock:
  				spin_lock_irq(&current->sighand->siglock);
  			}
  
@@ -2912,7 +2865,7 @@
  				/* It released the siglock.  */
  				goto relock;
  			}
-@@ -1907,13 +1780,13 @@ relock:
+@@ -1903,13 +1780,13 @@ relock:
  			 * first and our do_group_exit call below will use
  			 * that value and ignore the one we pass it.
  			 */
@@ -2928,7 +2881,7 @@
  		/* NOTREACHED */
  	}
  	spin_unlock_irq(&current->sighand->siglock);
-@@ -1925,7 +1798,6 @@ EXPORT_SYMBOL_GPL(dequeue_signal);
+@@ -1921,7 +1798,6 @@ EXPORT_SYMBOL_GPL(dequeue_signal);
  EXPORT_SYMBOL(flush_signals);
  EXPORT_SYMBOL(force_sig);
  EXPORT_SYMBOL(kill_proc);
@@ -3147,7 +3100,7 @@
  
 --- linux-2.6/include/linux/sched.h
 +++ linux-2.6/include/linux/sched.h
-@@ -936,7 +936,6 @@ struct task_struct {
+@@ -938,7 +938,6 @@ struct task_struct {
  	void *stack;
  	atomic_t usage;
  	unsigned int flags;	/* per process flags, defined below */
@@ -3155,7 +3108,7 @@
  
  	int lock_depth;		/* BKL lock depth */
  
-@@ -970,12 +969,6 @@ struct task_struct {
+@@ -972,12 +971,6 @@ struct task_struct {
  #endif
  
  	struct list_head tasks;
@@ -3168,7 +3121,7 @@
  
  	struct mm_struct *mm, *active_mm;
  
-@@ -995,15 +988,13 @@ struct task_struct {
+@@ -997,15 +990,13 @@ struct task_struct {
  	unsigned long stack_canary;
  #endif
  	/* 
@@ -3186,7 +3139,7 @@
  	 */
  	struct list_head children;	/* list of my children */
  	struct list_head sibling;	/* linkage in my parent's children list */
-@@ -1143,8 +1134,6 @@ struct task_struct {
+@@ -1145,8 +1136,6 @@ struct task_struct {
  
  	struct io_context *io_context;
  
@@ -3195,7 +3148,7 @@
  /*
   * current io wait handle: wait queue entry to use for io waits
   * If this thread is processing aio, this points at the waitqueue
-@@ -1521,6 +1510,7 @@ extern int kill_pgrp(struct pid *pid, in
+@@ -1523,6 +1512,7 @@ extern int kill_pgrp(struct pid *pid, in
  extern int kill_pid(struct pid *pid, int sig, int priv);
  extern int kill_proc_info(int, struct siginfo *, pid_t);
  extern void do_notify_parent(struct task_struct *, int);
@@ -3689,23 +3642,22 @@
 +#endif
 --- linux-2.6/include/asm-i386/thread_info.h
 +++ linux-2.6/include/asm-i386/thread_info.h
-@@ -129,7 +129,6 @@ static inline struct thread_info *curren
- #define TIF_NEED_RESCHED	3	/* rescheduling necessary */
- #define TIF_SINGLESTEP		4	/* restore singlestep on return to user mode */
- #define TIF_IRET		5	/* return with iret */
--#define TIF_SYSCALL_EMU		6	/* syscall emulation active */
- #define TIF_SYSCALL_AUDIT	7	/* syscall auditing active */
- #define TIF_SECCOMP		8	/* secure computing */
- #define TIF_RESTORE_SIGMASK	9	/* restore signal mask in do_signal() */
-@@ -138,6 +137,7 @@ static inline struct thread_info *curren
+@@ -128,7 +128,6 @@ static inline struct thread_info *curren
+ #define TIF_NEED_RESCHED	2	/* rescheduling necessary */
+ #define TIF_SINGLESTEP		3	/* restore singlestep on return to user mode */
+ #define TIF_IRET		4	/* return with iret */
+-#define TIF_SYSCALL_EMU		5	/* syscall emulation active */
+ #define TIF_SYSCALL_AUDIT	6	/* syscall auditing active */
+ #define TIF_SECCOMP		7	/* secure computing */
+ #define TIF_RESTORE_SIGMASK	8	/* restore signal mask in do_signal() */
+@@ -137,13 +136,13 @@ static inline struct thread_info *curren
  #define TIF_IO_BITMAP		18	/* uses I/O bitmap */
  #define TIF_FREEZE		19	/* is freezing for suspend */
  #define TIF_NOTSC		20	/* TSC is not accessible in userland */
 +#define TIF_FORCED_TF		21	/* true if TF in eflags artificially */
  
  #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
- #define _TIF_NOTIFY_RESUME	(1<<TIF_NOTIFY_RESUME)
-@@ -145,7 +145,6 @@ static inline struct thread_info *curren
+ #define _TIF_SIGPENDING		(1<<TIF_SIGPENDING)
  #define _TIF_NEED_RESCHED	(1<<TIF_NEED_RESCHED)
  #define _TIF_SINGLESTEP		(1<<TIF_SINGLESTEP)
  #define _TIF_IRET		(1<<TIF_IRET)
@@ -3713,7 +3665,7 @@
  #define _TIF_SYSCALL_AUDIT	(1<<TIF_SYSCALL_AUDIT)
  #define _TIF_SECCOMP		(1<<TIF_SECCOMP)
  #define _TIF_RESTORE_SIGMASK	(1<<TIF_RESTORE_SIGMASK)
-@@ -153,11 +152,11 @@ static inline struct thread_info *curren
+@@ -151,11 +150,11 @@ static inline struct thread_info *curren
  #define _TIF_IO_BITMAP		(1<<TIF_IO_BITMAP)
  #define _TIF_FREEZE		(1<<TIF_FREEZE)
  #define _TIF_NOTSC		(1<<TIF_NOTSC)
@@ -3849,7 +3801,7 @@
 +#endif
 --- linux-2.6/include/asm-x86_64/thread_info.h
 +++ linux-2.6/include/asm-x86_64/thread_info.h
-@@ -116,7 +116,7 @@ static inline struct thread_info *stack_
+@@ -115,7 +115,7 @@ static inline struct thread_info *stack_
  #define TIF_SECCOMP		8	/* secure computing */
  #define TIF_RESTORE_SIGMASK	9	/* restore signal mask in do_signal */
  #define TIF_MCE_NOTIFY		10	/* notify userspace of an MCE */
@@ -3858,7 +3810,7 @@
  #define TIF_IA32		17	/* 32bit process */ 
  #define TIF_FORK		18	/* ret_from_fork */
  #define TIF_ABI_PENDING		19
-@@ -135,6 +135,7 @@ static inline struct thread_info *stack_
+@@ -133,6 +133,7 @@ static inline struct thread_info *stack_
  #define _TIF_SECCOMP		(1<<TIF_SECCOMP)
  #define _TIF_RESTORE_SIGMASK	(1<<TIF_RESTORE_SIGMASK)
  #define _TIF_MCE_NOTIFY		(1<<TIF_MCE_NOTIFY)




More information about the fedora-extras-commits mailing list