rpms/kernel/FC-6 linux-2.6-utrace.patch,1.34,1.35

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Oct 27 02:12:17 UTC 2006


Author: roland

Update of /cvs/dist/rpms/kernel/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv21812

Modified Files:
	linux-2.6-utrace.patch 
Log Message:
update utrace patch to avoid spurious BUG_ON after SIGKILL

linux-2.6-utrace.patch:
 Documentation/utrace.txt                |  455 ++++++++
 arch/alpha/kernel/asm-offsets.c         |    2 
 arch/alpha/kernel/entry.S               |    4 
 arch/arm/kernel/ptrace.c                |   36 
 arch/arm26/kernel/ptrace.c              |   32 
 arch/frv/kernel/ptrace.c                |   15 
 arch/i386/kernel/entry.S                |    7 
 arch/i386/kernel/i387.c                 |  143 +-
 arch/i386/kernel/process.c              |    3 
 arch/i386/kernel/ptrace.c               |  863 ++++++++-------
 arch/i386/kernel/signal.c               |   37 
 arch/i386/kernel/vm86.c                 |    7 
 arch/ia64/ia32/ia32_entry.S             |    2 
 arch/ia64/ia32/sys_ia32.c               |   23 
 arch/ia64/kernel/asm-offsets.c          |    2 
 arch/ia64/kernel/fsys.S                 |   16 
 arch/ia64/kernel/mca.c                  |    2 
 arch/ia64/kernel/ptrace.c               | 1670 +++++++++++++++---------------
 arch/ia64/kernel/signal.c               |    4 
 arch/mips/kernel/ptrace.c               |   21 
 arch/mips/kernel/sysirix.c              |    2 
 arch/powerpc/kernel/Makefile            |    4 
 arch/powerpc/kernel/asm-offsets.c       |    2 
 arch/powerpc/kernel/process.c           |    5 
 arch/powerpc/kernel/ptrace-common.h     |  161 --
 arch/powerpc/kernel/ptrace.c            |  959 ++++++++++-------
 arch/powerpc/kernel/ptrace32.c          |  436 --------
 arch/powerpc/kernel/signal_32.c         |   55 +
 arch/powerpc/kernel/signal_64.c         |    3 
 arch/powerpc/kernel/sys_ppc32.c         |    5 
 arch/powerpc/lib/sstep.c                |    3 
 arch/powerpc/platforms/cell/spufs/run.c |    2 
 arch/ppc/kernel/asm-offsets.c           |    2 
 arch/s390/kernel/Makefile               |    2 
 arch/s390/kernel/compat_linux.c         |    3 
 arch/s390/kernel/compat_signal.c        |    5 
 arch/s390/kernel/process.c              |    3 
 arch/s390/kernel/ptrace.c               |  651 ++++++++++--
 arch/s390/kernel/signal.c               |    3 
 arch/s390/kernel/traps.c                |    6 
 arch/sparc64/kernel/Makefile            |    2 
 arch/sparc64/kernel/binfmt_aout32.c     |    2 
 arch/sparc64/kernel/entry.S             |    6 
 arch/sparc64/kernel/process.c           |    3 
 arch/sparc64/kernel/ptrace.c            | 1221 ++++++++++++----------
 arch/sparc64/kernel/signal.c            |    2 
 arch/sparc64/kernel/signal32.c          |    2 
 arch/sparc64/kernel/sys_sparc32.c       |    3 
 arch/sparc64/kernel/systbls.S           |    4 
 arch/x86_64/ia32/fpu32.c                |   92 +
 arch/x86_64/ia32/ia32_aout.c            |    6 
 arch/x86_64/ia32/ia32_signal.c          |    8 
 arch/x86_64/ia32/ia32entry.S            |    2 
 arch/x86_64/ia32/ptrace32.c             |  715 ++++++++-----
 arch/x86_64/ia32/sys_ia32.c             |    5 
 arch/x86_64/kernel/process.c            |    5 
 arch/x86_64/kernel/ptrace.c             |  648 +++++++----
 arch/x86_64/kernel/signal.c             |   28 
 arch/x86_64/kernel/traps.c              |    8 
 arch/x86_64/mm/fault.c                  |    4 
 drivers/connector/cn_proc.c             |    4 
 fs/binfmt_aout.c                        |    6 
 fs/binfmt_elf.c                         |    6 
 fs/binfmt_elf_fdpic.c                   |    7 
 fs/binfmt_flat.c                        |    3 
 fs/binfmt_som.c                         |    2 
 fs/exec.c                               |   11 
 fs/proc/array.c                         |   14 
 fs/proc/base.c                          |   17 
 include/asm-i386/i387.h                 |   13 
 include/asm-i386/signal.h               |    4 
 include/asm-i386/thread_info.h          |    7 
 include/asm-i386/tracehook.h            |   49 
 include/asm-ia64/elf.h                  |   24 
 include/asm-ia64/tracehook.h            |   81 +
 include/asm-powerpc/tracehook.h         |   80 +
 include/asm-s390/tracehook.h            |   53 
 include/asm-sparc64/tracehook.h         |   44 
 include/asm-x86_64/fpu32.h              |    3 
 include/asm-x86_64/thread_info.h        |    2 
 include/asm-x86_64/tracehook.h          |   54 
 include/linux/init_task.h               |    3 
 include/linux/ptrace.h                  |  224 +++-
 include/linux/sched.h                   |   25 
 include/linux/tracehook.h               |  707 +++++++++++++
 include/linux/utrace.h                  |  484 ++++++++
 init/Kconfig                            |   29 
 kernel/Makefile                         |    1 
 kernel/exit.c                           |  254 +---
 kernel/fork.c                           |   62 -
 kernel/ptrace.c                         | 1645 ++++++++++++++++++++++++------
 kernel/signal.c                         |  211 ---
 kernel/sys.c                            |    2 
 kernel/timer.c                          |    4 
 kernel/utrace.c                         | 1732 ++++++++++++++++++++++++++++++++
 security/selinux/hooks.c                |   54 
 security/selinux/include/objsec.h       |    1 
 97 files changed, 9778 insertions(+), 4566 deletions(-)

Index: linux-2.6-utrace.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/linux-2.6-utrace.patch,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- linux-2.6-utrace.patch	24 Oct 2006 02:19:14 -0000	1.34
+++ linux-2.6-utrace.patch	27 Oct 2006 02:12:14 -0000	1.35
@@ -89,14 +89,14 @@
  kernel/Makefile                         |    1 
  kernel/exit.c                           |  254 +----
  kernel/fork.c                           |   62 -
- kernel/ptrace.c                         | 1632 +++++++++++++++++++++++------
+ kernel/ptrace.c                         | 1645 +++++++++++++++++++++++------
  kernel/signal.c                         |  211 +---
  kernel/sys.c                            |    2 
  kernel/timer.c                          |    4 
  kernel/utrace.c                         | 1732 +++++++++++++++++++++++++++++++
  security/selinux/hooks.c                |   54 +
  security/selinux/include/objsec.h       |    1 
- 98 files changed, 9764 insertions(+), 4567 deletions(-)
+ 98 files changed, 9778 insertions(+), 4566 deletions(-)
  create mode 100644 Documentation/utrace.txt
  delete arch/powerpc/kernel/ptrace-common.h
  delete arch/powerpc/kernel/ptrace32.c
@@ -5682,7 +5682,7 @@
  /*
   * Access another process' address space.
   * Source/target buffer must be kernel space, 
-@@ -295,249 +125,1371 @@ int access_process_vm(struct task_struct
+@@ -295,249 +125,1386 @@ int access_process_vm(struct task_struct
  	return buf - old_buf;
  }
  
@@ -6096,7 +6096,7 @@
 +
 +		return utrace_inject_signal(target, engine,
 +					    UTRACE_ACTION_RESUME, info, NULL);
-+	}
+ 	}
 +
 +	return 0;
 +}
@@ -6169,7 +6169,7 @@
 +		else
 +			ret = (*regset->get)(target, regset, pos, regset->size,
 +					     NULL, data);
- 	}
++	}
 +
 +	return ret;
 +}
@@ -6441,7 +6441,7 @@
 +		state->u.live.options = data;
 +		ptrace_update(child, engine, UTRACE_ACTION_QUIESCE);
 +		ret = 0;
- 		break;
++		break;
 +	}
 +
 +	return ret;
@@ -6489,7 +6489,7 @@
 +		if (copied != sizeof(tmp))
 +			break;
 +		ret = put_user(tmp, (unsigned long __user *) data);
-+		break;
+ 		break;
 +	}
 +
 +	case PTRACE_POKETEXT: /* write the word at location addr. */
@@ -6841,7 +6841,10 @@
  	 */
 -	if (pid == 1)
 -		return ERR_PTR(-EPERM);
--
++	wake_up_interruptible_sync(&parent->signal->wait_chldexit);
++	spin_unlock_irqrestore(&sighand->siglock, flags);
++}
+ 
 -	read_lock(&tasklist_lock);
 -	child = find_task_by_pid(pid);
 -	if (child)
@@ -6850,18 +6853,10 @@
 -	if (!child)
 -		return ERR_PTR(-ESRCH);
 -	return child;
-+	wake_up_interruptible_sync(&parent->signal->wait_chldexit);
-+	spin_unlock_irqrestore(&sighand->siglock, flags);
- }
- 
--#ifndef __ARCH_SYS_PTRACE
--asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
 +static u32
 +ptrace_report(struct utrace_attached_engine *engine, struct task_struct *tsk,
 +	      int code)
- {
--	struct task_struct *child;
--	long ret;
++{
 +	struct ptrace_state *state = (struct ptrace_state *) engine->data;
 +	const struct utrace_regset *regset;
 +
@@ -6887,17 +6882,13 @@
 +	 * try to resume us with PTRACE_CONT before we set the flag.
 +	 */
 +	utrace_set_flags(tsk, engine, engine->flags | UTRACE_ACTION_QUIESCE);
- 
- 	/*
--	 * This lock_kernel fixes a subtle race with suid exec
++
++	/*
 +	 * If regset 0 has a writeback call, do it now.  On register window
 +	 * machines, this makes sure the user memory backing the register
 +	 * data is up to date by the time wait_task_inactive returns to
 +	 * ptrace_start in our tracer doing a PTRACE_PEEKDATA or the like.
- 	 */
--	lock_kernel();
--	if (request == PTRACE_TRACEME) {
--		ret = ptrace_traceme();
++	 */
 +	regset = utrace_regset(tsk, engine, utrace_native_view(tsk), 0);
 +	if (regset->writeback)
 +		(*regset->writeback)(tsk, regset, 0);
@@ -6913,12 +6904,16 @@
 +#endif
 +
 +	return UTRACE_ACTION_RESUME;
-+}
-+
+ }
+ 
+-#ifndef __ARCH_SYS_PTRACE
+-asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
 +static inline u32
 +ptrace_event(struct utrace_attached_engine *engine, struct task_struct *tsk,
 +	     int event)
-+{
+ {
+-	struct task_struct *child;
+-	long ret;
 +	struct ptrace_state *state = (struct ptrace_state *) engine->data;
 +	state->u.live.syscall = 0;
 +	return ptrace_report(engine, tsk, (event << 8) | SIGTRAP);
@@ -6945,6 +6940,16 @@
 +		ptrace_done(state);
 +		return UTRACE_ACTION_DETACH;
 +	}
+ 
+ 	/*
+-	 * This lock_kernel fixes a subtle race with suid exec
++	 * We can get here with the stopped flag still set when
++	 * we are dying with a SIGKILL that broke us out of quiescence.
+ 	 */
+-	lock_kernel();
+-	if (request == PTRACE_TRACEME) {
+-		ret = ptrace_traceme();
++	state->u.live.stopped = 0;
 +
 +	state->u.live.reported = 0;
 +	do_notify(tsk, state->parent, CLD_EXITED);
@@ -7082,7 +7087,8 @@
 +	state->u.live.have_eventmsg = 0;
 +	state->u.live.u.siginfo = info;
 +	return ptrace_report(engine, tsk, signo) | UTRACE_SIGNAL_IGN;
-+}
+ }
+-#endif /* __ARCH_SYS_PTRACE */
 +
 +static u32
 +ptrace_report_jctl(struct utrace_attached_engine *engine,
@@ -7091,8 +7097,7 @@
 +	struct ptrace_state *state = (struct ptrace_state *) engine->data;
 +	do_notify(tsk, state->parent, type);
 +	return UTRACE_JCTL_NOSIGCHLD;
- }
--#endif /* __ARCH_SYS_PTRACE */
++}
 +
 +static u32
 +ptrace_report_exec(struct utrace_attached_engine *engine,
@@ -7142,6 +7147,15 @@
 +		   struct task_struct *tsk, long orig_code, long *code)
 +{
 +	struct ptrace_state *state = (struct ptrace_state *) engine->data;
++
++	/*
++	 * We can get here with the stopped flag still set when
++	 * we are dying with a SIGKILL that broke us out of quiescence.
++	 */
++	if (state->u.live.stopped)
++		WARN_ON(orig_code != SIGKILL);
++	state->u.live.stopped = 0;
++
 +	state->u.live.have_eventmsg = 1;
 +	state->u.live.u.eventmsg = *code;
 +	return ptrace_event(engine, tsk, PTRACE_EVENT_EXIT);




More information about the fedora-cvs-commits mailing list