rpms/kernel/FC-6 kernel-2.6.spec, 1.2819, 1.2820 linux-2.6-utrace.patch, 1.33, 1.34
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Tue Oct 24 02:19:17 UTC 2006
Author: roland
Update of /cvs/dist/rpms/kernel/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv19818
Modified Files:
kernel-2.6.spec linux-2.6-utrace.patch
Log Message:
Newer utrace update fixes SIGKILL issues (#210693)
Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/kernel-2.6.spec,v
retrieving revision 1.2819
retrieving revision 1.2820
diff -u -r1.2819 -r1.2820
--- kernel-2.6.spec 23 Oct 2006 20:10:10 -0000 1.2819
+++ kernel-2.6.spec 24 Oct 2006 02:19:14 -0000 1.2820
@@ -2061,6 +2061,12 @@
%endif
%changelog
+* Mon Oct 23 2006 Roland McGrath <roland at redhat.com>
+- New utrace patch:
+ - Clean up recent fixes.
+ - Fix races on detach.
+ - Fix SIGKILL issues.
+ - Resolves: rhbz #210693
* Mon Oct 23 2006 Marcelo Tosatti <mtosatti at redhat.com>
- Add sysprof to OLPC build
@@ -2068,9 +2074,6 @@
* Mon Oct 23 2006 David Woodhouse <dwmw2 at redhat.com>
- Control CAFÃ ECC with module option since it's broken for now
-* Mon Oct 23 2006 Roland McGrath <roland at redhat.com>
-- utrace update: clean up recent fixes, fix races on detach
-
* Sun Oct 22 2006 David Woodhouse <dwmw2 at redhat.com>
- Add hardware ECC support to CAFÃ NAND driver
- Fix compilation of camera driver
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 | 1632 +++++++++++++++++++++++-------
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, 9764 insertions(+), 4567 deletions(-)
Index: linux-2.6-utrace.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/linux-2.6-utrace.patch,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- linux-2.6-utrace.patch 23 Oct 2006 09:56:33 -0000 1.33
+++ linux-2.6-utrace.patch 24 Oct 2006 02:19:14 -0000 1.34
@@ -7,7 +7,7 @@
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/ptrace.c | 863 ++++++++-------
arch/i386/kernel/signal.c | 37 -
arch/i386/kernel/vm86.c | 7
arch/ia64/ia32/ia32_entry.S | 2
@@ -15,7 +15,7 @@
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/ptrace.c | 1670 +++++++++++++++---------------
arch/ia64/kernel/signal.c | 4
arch/mips/kernel/ptrace.c | 21
arch/mips/kernel/sysirix.c | 2
@@ -23,7 +23,7 @@
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/ptrace.c | 959 ++++++++++-------
arch/powerpc/kernel/ptrace32.c | 436 --------
arch/powerpc/kernel/signal_32.c | 55 +
arch/powerpc/kernel/signal_64.c | 3
@@ -89,14 +89,14 @@
kernel/Makefile | 1
kernel/exit.c | 254 +----
kernel/fork.c | 62 -
- kernel/ptrace.c | 1632 ++++++++++++++++++++++++------
+ kernel/ptrace.c | 1632 +++++++++++++++++++++++------
kernel/signal.c | 211 +---
kernel/sys.c | 2
kernel/timer.c | 4
- kernel/utrace.c | 1688 +++++++++++++++++++++++++++++++
+ kernel/utrace.c | 1732 +++++++++++++++++++++++++++++++
security/selinux/hooks.c | 54 +
security/selinux/include/objsec.h | 1
- 98 files changed, 9720 insertions(+), 4567 deletions(-)
+ 98 files changed, 9764 insertions(+), 4567 deletions(-)
create mode 100644 Documentation/utrace.txt
delete arch/powerpc/kernel/ptrace-common.h
delete arch/powerpc/kernel/ptrace32.c
@@ -1175,7 +1175,7 @@
+/*
+ * Hooks in <linux/tracehook.h> call these entry points to the utrace dispatch.
+ */
-+void utrace_quiescent(struct task_struct *, struct utrace_signal *);
++int utrace_quiescent(struct task_struct *, struct utrace_signal *);
+void utrace_release_task(struct task_struct *);
+int utrace_get_signal(struct task_struct *, struct pt_regs *,
+ siginfo_t *, struct k_sigaction *);
@@ -3228,7 +3228,7 @@
EXPORT_SYMBOL(sigprocmask);
--- linux-2.6/kernel/utrace.c.utrace-ptrace-compat
+++ linux-2.6/kernel/utrace.c
-@@ -0,0 +1,1688 @@
+@@ -0,0 +1,1732 @@
+#include <linux/utrace.h>
+#include <linux/tracehook.h>
+#include <linux/err.h>
@@ -3996,11 +3996,12 @@
+ return action;
+}
+
-+static inline void
++static inline int
+check_quiescent(struct task_struct *tsk, u32 action)
+{
+ if (action & UTRACE_ACTION_STATE_MASK)
-+ utrace_quiescent(tsk, NULL);
++ return utrace_quiescent(tsk, NULL);
++ return 0;
+}
+
+/*
@@ -4099,16 +4100,29 @@
+
+
+/*
++ * Return nonzero if there is a SIGKILL that should be waking us up.
++ * Called with the siglock held.
++ */
++static inline int
++sigkill_pending(struct task_struct *tsk)
++{
++ return ((sigismember(&tsk->pending.signal, SIGKILL)
++ || sigismember(&tsk->signal->shared_pending.signal, SIGKILL))
++ && !unlikely(sigismember(&tsk->blocked, SIGKILL)));
++}
++
++/*
+ * Called if UTRACE_EVENT(QUIESCE) or UTRACE_ACTION_QUIESCE flag is set.
+ * Also called after other event reports.
+ * It is a good time to block.
++ * Returns nonzero if we woke up prematurely due to SIGKILL.
+ *
+ * The signal pointer is nonzero when called from utrace_get_signal,
+ * where a pending forced signal can be processed right away. Otherwise,
+ * we keep UTRACE_ACTION_QUIESCE set after resuming so that utrace_get_signal
+ * will be entered before user mode.
+ */
-+void
++int
+utrace_quiescent(struct task_struct *tsk, struct utrace_signal *signal)
+{
+ struct utrace *utrace = tsk->utrace;
@@ -4123,6 +4137,8 @@
+ * If some engines want us quiescent, we block here.
+ */
+ if (action & UTRACE_ACTION_QUIESCE) {
++ int killed;
++
+ if (signal != NULL) {
+ BUG_ON(utrace->u.live.signal != NULL);
+ utrace->u.live.signal = signal;
@@ -4137,8 +4153,8 @@
+ * release the siglock it's waiting for.
+ * Never stop when there is a SIGKILL bringing us down.
+ */
-+ if ((tsk->utrace_flags & UTRACE_ACTION_QUIESCE)
-+ /*&& !(tsk->signal->flags & SIGNAL_GROUP_SIGKILL)*/) {
++ killed = sigkill_pending(tsk);
++ if (!killed && (tsk->utrace_flags & UTRACE_ACTION_QUIESCE)) {
+ set_current_state(TASK_TRACED);
+ /*
+ * If there is a group stop in progress,
@@ -4163,6 +4179,9 @@
+ utrace->u.live.signal = NULL;
+ }
+
++ if (killed) /* Game over, man! */
++ return 1;
++
+ /*
+ * We've woken up. One engine could be waking us up while
+ * another has asked us to quiesce. So check afresh. We
@@ -4216,6 +4235,8 @@
+ tracehook_enable_syscall_trace(tsk);
+ else
+ tracehook_disable_syscall_trace(tsk);
++
++ return 0;
+}
+
+
@@ -4392,7 +4413,12 @@
+ break;
+ }
+ action = check_detach(tsk, action);
-+ check_quiescent(tsk, action);
++ if (unlikely(check_quiescent(tsk, action)) && !is_exit)
++ /*
++ * We are continuing despite QUIESCE because of a SIGKILL.
++ * Don't let the system call actually proceed.
++ */
++ tracehook_abort_syscall(regs);
+}
+
+
@@ -4501,11 +4527,6 @@
+ struct k_sigaction *ka;
+ unsigned long action, event;
+
-+#if 0 /* XXX */
-+ if (tsk->signal->flags & SIGNAL_GROUP_SIGKILL)
-+ return 0;
-+#endif
-+
+ /*
+ * If a signal was injected previously, it could not use our
+ * stack space directly. It had to allocate a data structure,
@@ -4531,24 +4552,47 @@
+ * so that utrace_inject_signal can tell us what to do.
+ */
+ if (tsk->utrace_flags & UTRACE_ACTION_QUIESCE) {
-+ spin_unlock_irq(&tsk->sighand->siglock);
++ int killed = sigkill_pending(tsk);
++ if (!killed) {
++ spin_unlock_irq(&tsk->sighand->siglock);
+
-+ utrace_quiescent(tsk, &signal);
++ killed = utrace_quiescent(tsk, &signal);
+
-+ /*
-+ * Noone wants us quiescent any more, we can take signals.
-+ * Unless we have a forced signal to take, back out to the
-+ * signal code to resynchronize after releasing the siglock.
-+ */
-+ if (signal.signr == 0)
+ /*
-+ * This return value says to reacquire the siglock
-+ * and check again. This will check for a pending
-+ * group stop and process it before coming back here.
++ * Noone wants us quiescent any more, we can take
++ * signals. Unless we have a forced signal to take,
++ * back out to the signal code to resynchronize after
++ * releasing the siglock.
+ */
-+ return -1;
++ if (signal.signr == 0 && !killed)
++ /*
++ * This return value says to reacquire the
++ * siglock and check again. This will check
++ * for a pending group stop and process it
++ * before coming back here.
++ */
++ return -1;
+
-+ spin_lock_irq(&tsk->sighand->siglock);
++ spin_lock_irq(&tsk->sighand->siglock);
++ }
++ if (killed) {
++ /*
++ * The only reason we woke up now was because of a
++ * SIGKILL. Don't do normal dequeuing in case it
++ * might get a signal other than SIGKILL. That would
++ * perturb the death state so it might differ from
++ * what the debugger would have allowed to happen.
++ * Instead, pluck out just the SIGKILL to be sure
++ * we'll die immediately with nothing else different
++ * from the quiescent state the debugger wanted us in.
++ */
++ sigset_t sigkill_only;
++ sigfillset(&sigkill_only);
++ sigdelset(&sigkill_only, SIGKILL);
++ killed = dequeue_signal(tsk, &sigkill_only, info);
++ BUG_ON(killed != SIGKILL);
++ return killed;
++ }
+ }
+
+ /*
More information about the fedora-cvs-commits
mailing list