rpms/kernel/F-8 linux-2.6-kernel-doc-structs-private.patch, NONE, 1.1 linux-2.6.27-x86-tracehook-syscall-arg-order.patch, NONE, 1.1 kernel.spec, 1.556, 1.557 linux-2.6-tracehook.patch, 1.1, 1.2 linux-2.6-utrace.patch, 1.70, 1.71
Chuck Ebbert
cebbert at fedoraproject.org
Wed Oct 15 20:43:05 UTC 2008
Author: cebbert
Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23116
Modified Files:
kernel.spec linux-2.6-tracehook.patch linux-2.6-utrace.patch
Added Files:
linux-2.6-kernel-doc-structs-private.patch
linux-2.6.27-x86-tracehook-syscall-arg-order.patch
Log Message:
Copy utrace updates from F-9.
linux-2.6-kernel-doc-structs-private.patch:
--- NEW FILE linux-2.6-kernel-doc-structs-private.patch ---
commit 39f00c087d31f668eb6eaf97508af22a32c5b1d9
Author: Randy Dunlap <randy.dunlap at oracle.com>
Date: Mon Sep 22 13:57:44 2008 -0700
kernel-doc: allow structs whose members are all private
Struct members may be marked as private by using
/* private: */
before them, as noted in Documentation/kernel-doc-nano-HOWTO.txt
Fix kernel-doc to handle structs whose members are all private;
otherwise invalid XML is generated:
xmlto: input does not validate (status 3)
linux-2.6.27-rc6-git4/Documentation/DocBook/debugobjects.xml:146: element variablelist: validity error : Element variablelist content does not follow the DTD, expecting ((title , titleabbrev?)? , varlistentry+), got ()
Document linux-2.6.27-rc6-git4/Documentation/DocBook/debugobjects.xml does not validate
make[1]: *** [Documentation/DocBook/debugobjects.html] Error 3
Signed-off-by: Randy Dunlap <randy.dunlap at oracle.com>
Reported-by: Roland McGrath <roland at redhat.com>
Cc: Roland McGrath <roland at redhat.com>
Cc: Christoph Hellwig <hch at infradead.org>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---
scripts/kernel-doc | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index ff787e6..44ee94d 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -781,6 +781,7 @@ sub output_struct_xml(%) {
print " <refsect1>\n";
print " <title>Members</title>\n";
+ if ($#{$args{'parameterlist'}} >= 0) {
print " <variablelist>\n";
foreach $parameter (@{$args{'parameterlist'}}) {
($parameter =~ /^#/) && next;
@@ -798,6 +799,9 @@ sub output_struct_xml(%) {
print " </varlistentry>\n";
}
print " </variablelist>\n";
+ } else {
+ print " <para>\n None\n </para>\n";
+ }
print " </refsect1>\n";
output_section_xml(@_);
linux-2.6.27-x86-tracehook-syscall-arg-order.patch:
--- NEW FILE linux-2.6.27-x86-tracehook-syscall-arg-order.patch ---
commit 7e6bc5478812972b61e8d273028c9494d69b2665
Author: Roland McGrath <roland at redhat.com>
Date: Mon Oct 13 18:36:05 2008 -0700
x86 syscall.h: fix argument order
Petr Tesarik noticed that I'd bungled the syscall_get_arguments code for
64-bit kernels, so it inverted the order of the syscall argument registers.
Petr wrote a patch to fix that, and I've amended it to fix the same braino
in the syscall_set_arguments code.
Signed-off-by: Petr Tesarik <ptesarik at suse.cz>
Signed-off-by: Roland McGrath <roland at redhat.com>
---
include/asm-x86/syscall.h | 106 +++++++++++++++++++++++----------------------
1 files changed, 54 insertions(+), 52 deletions(-)
diff --git a/include/asm-x86/syscall.h b/include/asm-x86/syscall.h
index 04c47dc..ec2a95e 100644
--- a/include/asm-x86/syscall.h
+++ b/include/asm-x86/syscall.h
@@ -93,26 +93,26 @@ static inline void syscall_get_arguments(struct task_struct *task,
{
# ifdef CONFIG_IA32_EMULATION
if (task_thread_info(task)->status & TS_COMPAT)
- switch (i + n) {
- case 6:
+ switch (i) {
+ case 0:
if (!n--) break;
- *args++ = regs->bp;
- case 5:
+ *args++ = regs->bx;
+ case 1:
if (!n--) break;
- *args++ = regs->di;
- case 4:
+ *args++ = regs->cx;
+ case 2:
if (!n--) break;
- *args++ = regs->si;
+ *args++ = regs->dx;
case 3:
if (!n--) break;
- *args++ = regs->dx;
- case 2:
+ *args++ = regs->si;
+ case 4:
if (!n--) break;
- *args++ = regs->cx;
- case 1:
+ *args++ = regs->di;
+ case 5:
if (!n--) break;
- *args++ = regs->bx;
- case 0:
+ *args++ = regs->bp;
+ case 6:
if (!n--) break;
default:
BUG();
@@ -120,26 +120,26 @@ static inline void syscall_get_arguments(struct task_struct *task,
}
else
# endif
- switch (i + n) {
- case 6:
+ switch (i) {
+ case 0:
if (!n--) break;
- *args++ = regs->r9;
- case 5:
+ *args++ = regs->di;
+ case 1:
if (!n--) break;
- *args++ = regs->r8;
- case 4:
+ *args++ = regs->si;
+ case 2:
if (!n--) break;
- *args++ = regs->r10;
+ *args++ = regs->dx;
case 3:
if (!n--) break;
- *args++ = regs->dx;
- case 2:
+ *args++ = regs->r10;
+ case 4:
if (!n--) break;
- *args++ = regs->si;
- case 1:
+ *args++ = regs->r8;
+ case 5:
if (!n--) break;
- *args++ = regs->di;
- case 0:
+ *args++ = regs->r9;
+ case 6:
if (!n--) break;
default:
BUG();
@@ -154,55 +154,57 @@ static inline void syscall_set_arguments(struct task_struct *task,
{
# ifdef CONFIG_IA32_EMULATION
if (task_thread_info(task)->status & TS_COMPAT)
- switch (i + n) {
- case 6:
+ switch (i) {
+ case 0:
if (!n--) break;
- regs->bp = *args++;
- case 5:
+ regs->bx = *args++;
+ case 1:
if (!n--) break;
- regs->di = *args++;
- case 4:
+ regs->cx = *args++;
+ case 2:
if (!n--) break;
- regs->si = *args++;
+ regs->dx = *args++;
case 3:
if (!n--) break;
- regs->dx = *args++;
- case 2:
+ regs->si = *args++;
+ case 4:
if (!n--) break;
- regs->cx = *args++;
- case 1:
+ regs->di = *args++;
+ case 5:
if (!n--) break;
- regs->bx = *args++;
- case 0:
+ regs->bp = *args++;
+ case 6:
if (!n--) break;
default:
BUG();
+ break;
}
else
# endif
- switch (i + n) {
- case 6:
+ switch (i) {
+ case 0:
if (!n--) break;
- regs->r9 = *args++;
- case 5:
+ regs->di = *args++;
+ case 1:
if (!n--) break;
- regs->r8 = *args++;
- case 4:
+ regs->si = *args++;
+ case 2:
if (!n--) break;
- regs->r10 = *args++;
+ regs->dx = *args++;
case 3:
if (!n--) break;
- regs->dx = *args++;
- case 2:
+ regs->r10 = *args++;
+ case 4:
if (!n--) break;
- regs->si = *args++;
- case 1:
+ regs->r8 = *args++;
+ case 5:
if (!n--) break;
- regs->di = *args++;
- case 0:
+ regs->r9 = *args++;
+ case 6:
if (!n--) break;
default:
BUG();
+ break;
}
}
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/kernel.spec,v
retrieving revision 1.556
retrieving revision 1.557
diff -u -r1.556 -r1.557
--- kernel.spec 14 Oct 2008 10:06:00 -0000 1.556
+++ kernel.spec 15 Oct 2008 20:42:34 -0000 1.557
@@ -579,6 +579,8 @@
Patch20: linux-2.6-ptrace-cleanup.patch
Patch21: linux-2.6-tracehook.patch
Patch22: linux-2.6-utrace.patch
+Patch23: linux-2.6-kernel-doc-structs-private.patch
+Patch24: linux-2.6.27-x86-tracehook-syscall-arg-order.patch
Patch41: linux-2.6-sysrq-c.patch
Patch42: linux-2.6-sched-clock-fix-nohz-interaction.patch
@@ -1017,6 +1019,8 @@
ApplyPatch linux-2.6-ptrace-cleanup.patch
ApplyPatch linux-2.6-tracehook.patch
ApplyPatch linux-2.6-utrace.patch
+ApplyPatch linux-2.6-kernel-doc-structs-private.patch
+ApplyPatch linux-2.6.27-x86-tracehook-syscall-arg-order.patch
# ALSA
@@ -1885,6 +1889,9 @@
%changelog
+* Tue Oct 14 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.26.6-47
+- Copy utrace updates from F-9.
+
* Tue Oct 14 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.26.6-46
- Fix pci mmap range checking to work without the WARN() macro.
linux-2.6-tracehook.patch:
Index: linux-2.6-tracehook.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-tracehook.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-tracehook.patch 8 Aug 2008 18:56:00 -0000 1.1
+++ linux-2.6-tracehook.patch 15 Oct 2008 20:42:34 -0000 1.2
@@ -1,62 +1,62 @@
- arch/Kconfig | 18 ++
- arch/ia64/Kconfig | 1 +
- arch/ia64/kernel/perfmon.c | 11 +-
- arch/ia64/kernel/process.c | 21 +-
- arch/ia64/kernel/ptrace.c | 43 +--
- arch/ia64/kernel/signal.c | 8 +
- arch/mips/kernel/irixelf.c | 2 -
- arch/powerpc/Kconfig | 1 +
- arch/powerpc/kernel/entry_32.S | 11 +-
- arch/powerpc/kernel/entry_64.S | 10 +-
- arch/powerpc/kernel/ptrace.c | 47 ++--
- arch/powerpc/kernel/signal.c | 21 ++-
- arch/sparc64/Kconfig | 1 +
- arch/sparc64/kernel/ptrace.c | 24 +--
- arch/sparc64/kernel/rtrap.S | 6 +-
- arch/sparc64/kernel/signal.c | 5 +
- arch/x86/Kconfig | 1 +
- arch/x86/ia32/ia32_aout.c | 6 -
- arch/x86/kernel/ptrace.c | 34 +--
- arch/x86/kernel/signal_32.c | 11 +-
- arch/x86/kernel/signal_64.c | 49 +---
- 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 | 12 +-
- fs/proc/array.c | 9 +-
- fs/proc/base.c | 39 +++-
+ arch/Kconfig | 18 +
+ arch/ia64/Kconfig | 1
+ arch/ia64/kernel/perfmon.c | 11
+ arch/ia64/kernel/process.c | 20 -
+ arch/ia64/kernel/ptrace.c | 43 --
+ arch/ia64/kernel/signal.c | 8
+ arch/mips/kernel/irixelf.c | 2
+ arch/powerpc/Kconfig | 1
+ arch/powerpc/kernel/entry_32.S | 11
+ arch/powerpc/kernel/entry_64.S | 10
+ arch/powerpc/kernel/ptrace.c | 47 +--
+ arch/powerpc/kernel/signal.c | 21 +
+ arch/sparc64/Kconfig | 1
+ arch/sparc64/kernel/ptrace.c | 24 -
+ arch/sparc64/kernel/rtrap.S | 6
+ arch/sparc64/kernel/signal.c | 5
+ arch/x86/Kconfig | 1
+ arch/x86/ia32/ia32_aout.c | 6
+ arch/x86/kernel/ptrace.c | 34 --
+ arch/x86/kernel/signal_32.c | 11
+ arch/x86/kernel/signal_64.c | 49 ---
+ 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 | 12
+ fs/proc/array.c | 9
+ fs/proc/base.c | 39 ++
include/asm-generic/syscall.h | 141 +++++++++
- include/asm-ia64/thread_info.h | 3 -
- include/asm-powerpc/ptrace.h | 1 +
- include/asm-powerpc/signal.h | 3 +-
- include/asm-powerpc/syscall.h | 73 +++++
- include/asm-powerpc/thread_info.h | 5 +-
- include/asm-sparc64/ptrace.h | 1 +
- include/asm-sparc64/syscall.h | 70 +++++
- include/asm-sparc64/thread_info.h | 8 +-
- include/asm-x86/ptrace.h | 5 +
- include/asm-x86/syscall.h | 210 ++++++++++++++
- include/asm-x86/thread_info_32.h | 2 +
- include/asm-x86/thread_info_64.h | 4 +-
- include/linux/ptrace.h | 72 +++++
- include/linux/sched.h | 10 +-
- include/linux/tracehook.h | 575 +++++++++++++++++++++++++++++++++++++
- kernel/exit.c | 53 ++---
- kernel/fork.c | 74 ++---
- kernel/kthread.c | 2 +-
- kernel/ptrace.c | 2 +-
- kernel/sched.c | 29 ++-
- kernel/signal.c | 99 ++++---
- lib/Makefile | 2 +
- lib/syscall.c | 75 +++++
- mm/nommu.c | 4 +-
- security/selinux/hooks.c | 22 +--
- 55 files changed, 1589 insertions(+), 371 deletions(-)
+ include/asm-ia64/thread_info.h | 3
+ include/asm-powerpc/ptrace.h | 1
+ include/asm-powerpc/signal.h | 3
+ include/asm-powerpc/syscall.h | 73 ++++
+ include/asm-powerpc/thread_info.h | 5
+ include/asm-sparc64/ptrace.h | 1
+ include/asm-sparc64/syscall.h | 70 ++++
+ include/asm-sparc64/thread_info.h | 8
+ include/asm-x86/ptrace.h | 5
+ include/asm-x86/syscall.h | 210 +++++++++++++
+ include/asm-x86/thread_info_32.h | 2
+ include/asm-x86/thread_info_64.h | 4
+ include/linux/ptrace.h | 72 ++++
+ include/linux/sched.h | 10
+ include/linux/tracehook.h | 582 ++++++++++++++++++++++++++++++++++++++
+ kernel/exit.c | 55 +--
+ kernel/fork.c | 74 +---
+ kernel/kthread.c | 2
+ kernel/ptrace.c | 2
+ kernel/sched.c | 29 +
+ kernel/signal.c | 99 ++++--
+ lib/Makefile | 2
+ lib/syscall.c | 75 ++++
+ mm/nommu.c | 4
+ security/selinux/hooks.c | 22 -
+ 55 files changed, 1597 insertions(+), 371 deletions(-)
-diff --git a/arch/Kconfig b/arch/Kconfig
-index 3ea332b..1955fbd 100644
+Index: b/arch/Kconfig
+===================================================================
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -39,3 +39,21 @@ config HAVE_KRETPROBES
@@ -81,8 +81,8 @@
+#
+config HAVE_ARCH_TRACEHOOK
+ def_bool n
-diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
-index 16be414..f23a54a 100644
+Index: b/arch/ia64/Kconfig
+===================================================================
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -19,6 +19,7 @@ config IA64
@@ -93,8 +93,8 @@
select HAVE_DMA_ATTRS
select HAVE_KVM
default y
-diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
-index 7714a97..189d525 100644
+Index: b/arch/ia64/kernel/perfmon.c
+===================================================================
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -40,6 +40,7 @@
@@ -150,8 +150,8 @@
}
/*
* defer until state is changed (shorten spin window). the context is locked
-diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
-index a3a34b4..ff448fe 100644
+Index: b/arch/ia64/kernel/process.c
+===================================================================
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -156,21 +156,6 @@ show_regs (struct pt_regs *regs)
@@ -188,8 +188,8 @@
/* copy user rbs to kernel rbs */
if (unlikely(test_thread_flag(TIF_RESTORE_RSE))) {
local_irq_enable(); /* force interrupt enable */
-diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
-index 2a9943b..3ba40a1 100644
+Index: b/arch/ia64/kernel/ptrace.c
+===================================================================
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -22,6 +22,7 @@
@@ -298,8 +298,8 @@
return do_regset_call(do_gpregs_writeback, target, regset, 0, 0,
NULL, NULL);
}
-diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
-index 19c5a78..e12500a 100644
+Index: b/arch/ia64/kernel/signal.c
+===================================================================
--- a/arch/ia64/kernel/signal.c
+++ b/arch/ia64/kernel/signal.c
@@ -11,6 +11,7 @@
@@ -324,8 +324,8 @@
return 1;
}
-diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
-index 469c723..a48edbe 100644
+Index: b/arch/mips/kernel/irixelf.c
+===================================================================
--- a/arch/mips/kernel/irixelf.c
+++ b/arch/mips/kernel/irixelf.c
@@ -808,8 +808,6 @@ static int load_irix_binary(struct linux
@@ -337,8 +337,8 @@
return 0;
out:
return retval;
-diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
-index 3934e26..52486c7 100644
+Index: b/arch/powerpc/Kconfig
+===================================================================
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -109,6 +109,7 @@ config PPC
@@ -349,8 +349,8 @@
select HAVE_LMB
config EARLY_PRINTK
-diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
-index 3a05e9f..eb40c67 100644
+Index: b/arch/powerpc/kernel/entry_32.S
+===================================================================
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -299,7 +299,12 @@ syscall_dotrace:
@@ -378,8 +378,8 @@
bl do_signal
REST_NVGPRS(r1)
b recheck
-diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
-index c0db5b7..2a13029 100644
+Index: b/arch/powerpc/kernel/entry_64.S
+===================================================================
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -213,7 +213,12 @@ syscall_dotrace:
@@ -406,8 +406,8 @@
bl .do_signal
b .ret_from_except
-diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
-index 91ee077..b9bf411 100644
+Index: b/arch/powerpc/kernel/ptrace.c
+===================================================================
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -22,6 +22,7 @@
@@ -488,8 +488,8 @@
+ if (step || test_thread_flag(TIF_SYSCALL_TRACE))
+ tracehook_report_syscall_exit(regs, step);
}
-diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
-index ad55488..e032336 100644
+Index: b/arch/powerpc/kernel/signal.c
+===================================================================
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -9,7 +9,7 @@
@@ -539,8 +539,8 @@
long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
unsigned long r5, unsigned long r6, unsigned long r7,
unsigned long r8, struct pt_regs *regs)
-diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
-index eb36f3b..94504d4 100644
+Index: b/arch/sparc64/Kconfig
+===================================================================
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -11,6 +11,7 @@ config SPARC
@@ -551,8 +551,8 @@
select HAVE_IDE
select HAVE_LMB
select HAVE_ARCH_KGDB
-diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
-index f6c9fc9..2e3f998 100644
+Index: b/arch/sparc64/kernel/ptrace.c
+===================================================================
--- a/arch/sparc64/kernel/ptrace.c
+++ b/arch/sparc64/kernel/ptrace.c
@@ -23,6 +23,7 @@
@@ -595,8 +595,8 @@
if (unlikely(current->audit_context) && !syscall_exit_p)
audit_syscall_entry((test_thread_flag(TIF_32BIT) ?
AUDIT_ARCH_SPARC :
-diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S
-index c6fc695..97a993c 100644
+Index: b/arch/sparc64/kernel/rtrap.S
+===================================================================
--- a/arch/sparc64/kernel/rtrap.S
+++ b/arch/sparc64/kernel/rtrap.S
@@ -46,7 +46,7 @@ __handle_user_windows:
@@ -626,8 +626,8 @@
bne,pn %xcc, __handle_signal
__handle_signal_continue:
ldub [%g6 + TI_WSAVED], %o2
-diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
-index 9667e96..9424fda 100644
+Index: b/arch/sparc64/kernel/signal.c
+===================================================================
--- a/arch/sparc64/kernel/signal.c
+++ b/arch/sparc64/kernel/signal.c
@@ -17,6 +17,7 @@
@@ -638,7 +638,7 @@
#include <linux/unistd.h>
#include <linux/mm.h>
#include <linux/tty.h>
-@@ -605,4 +606,8 @@ void do_notify_resume(struct pt_regs *re
+@@ -607,4 +608,8 @@ void do_notify_resume(struct pt_regs *re
{
if (thread_info_flags & _TIF_SIGPENDING)
do_signal(regs, orig_i0);
@@ -647,8 +647,8 @@
+ tracehook_notify_resume(regs);
+ }
}
-diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
-index bf07b6f..1c42efb 100644
+Index: b/arch/x86/Kconfig
+===================================================================
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -25,6 +25,7 @@ config X86
@@ -659,8 +659,8 @@
config ARCH_DEFCONFIG
string
-diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
-index 58cccb6..a0e1dbe 100644
+Index: b/arch/x86/ia32/ia32_aout.c
+===================================================================
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -441,12 +441,6 @@ beyond_if:
@@ -676,8 +676,8 @@
return 0;
}
-diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
-index 652f550..d537484 100644
+Index: b/arch/x86/kernel/ptrace.c
+===================================================================
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -14,6 +14,7 @@
@@ -748,8 +748,8 @@
+ tracehook_consider_fatal_signal(current, SIGTRAP, SIG_DFL))
send_sigtrap(current, regs, 0);
}
-diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
-index 295b5f5..c17c0cb 100644
+Index: b/arch/x86/kernel/signal_32.c
+===================================================================
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -17,6 +17,7 @@
@@ -791,8 +791,8 @@
if (thread_info_flags & _TIF_HRTICK_RESCHED)
hrtick_resched();
-diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
-index bf87684..f65ece6 100644
+Index: b/arch/x86/kernel/signal_64.c
+===================================================================
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -15,6 +15,7 @@
@@ -811,7 +811,7 @@
#include "sigframe.h"
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
-@@ -293,35 +295,6 @@ give_sigsegv:
+@@ -355,35 +357,6 @@ give_sigsegv:
}
/*
@@ -847,7 +847,7 @@
* OK, we're invoking a handler
*/
-@@ -332,9 +305,9 @@ handle_signal(unsigned long sig, siginfo
+@@ -394,9 +367,9 @@ handle_signal(unsigned long sig, siginfo
int ret;
/* Are we from a system call? */
@@ -859,7 +859,7 @@
case -ERESTART_RESTARTBLOCK:
case -ERESTARTNOHAND:
regs->ax = -EINTR;
-@@ -391,8 +364,6 @@ handle_signal(unsigned long sig, siginfo
+@@ -453,8 +426,6 @@ handle_signal(unsigned long sig, siginfo
* handler too.
*/
regs->flags &= ~X86_EFLAGS_TF;
@@ -868,7 +868,7 @@
spin_lock_irq(¤t->sighand->siglock);
sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask);
-@@ -400,6 +371,9 @@ handle_signal(unsigned long sig, siginfo
+@@ -462,6 +433,9 @@ handle_signal(unsigned long sig, siginfo
sigaddset(¤t->blocked,sig);
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
@@ -878,7 +878,7 @@
}
return ret;
-@@ -456,9 +430,9 @@ static void do_signal(struct pt_regs *re
+@@ -518,9 +492,9 @@ static void do_signal(struct pt_regs *re
}
/* Did we come from a system call? */
@@ -890,7 +890,7 @@
case -ERESTARTNOHAND:
case -ERESTARTSYS:
case -ERESTARTNOINTR:
-@@ -497,6 +471,11 @@ void do_notify_resume(struct pt_regs *re
+@@ -559,6 +533,11 @@ void do_notify_resume(struct pt_regs *re
if (thread_info_flags & _TIF_SIGPENDING)
do_signal(regs);
@@ -902,8 +902,8 @@
if (thread_info_flags & _TIF_HRTICK_RESCHED)
hrtick_resched();
}
-diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
-index ba4cddb..204cfd1 100644
+Index: b/fs/binfmt_aout.c
+===================================================================
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -444,12 +444,6 @@ beyond_if:
@@ -919,8 +919,8 @@
return 0;
}
-diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
-index d48ff5f..66a2bdc 100644
+Index: b/fs/binfmt_elf.c
+===================================================================
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -974,12 +974,6 @@ static int load_elf_binary(struct linux_
@@ -936,8 +936,8 @@
retval = 0;
out:
kfree(loc);
-diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
-index d051a32..1280d5d 100644
+Index: b/fs/binfmt_elf_fdpic.c
+===================================================================
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -433,13 +433,6 @@ static int load_elf_fdpic_binary(struct
@@ -954,8 +954,8 @@
retval = 0;
error:
-diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
-index 2cb1acd..56372ec 100644
+Index: b/fs/binfmt_flat.c
+===================================================================
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -920,9 +920,6 @@ static int load_flat_binary(struct linux
@@ -968,8 +968,8 @@
return 0;
}
-diff --git a/fs/binfmt_som.c b/fs/binfmt_som.c
-index fdc36bf..68be580 100644
+Index: b/fs/binfmt_som.c
+===================================================================
--- a/fs/binfmt_som.c
+++ b/fs/binfmt_som.c
@@ -274,8 +274,6 @@ load_som_binary(struct linux_binprm * bp
@@ -981,8 +981,8 @@
return 0;
/* error cleanup */
-diff --git a/fs/exec.c b/fs/exec.c
-index fd92343..346db53 100644
+Index: b/fs/exec.c
+===================================================================
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -43,7 +43,6 @@
@@ -1025,8 +1025,8 @@
put_binfmt(fmt);
allow_write_access(bprm->file);
if (bprm->file)
-diff --git a/fs/proc/array.c b/fs/proc/array.c
-index 797d775..0d6eb33 100644
+Index: b/fs/proc/array.c
+===================================================================
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -80,6 +80,7 @@
@@ -1052,8 +1052,8 @@
seq_printf(m,
"State:\t%s\n"
"Tgid:\t%d\n"
-diff --git a/fs/proc/base.c b/fs/proc/base.c
-index 3b45537..eb59321 100644
+Index: b/fs/proc/base.c
+===================================================================
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -69,6 +69,7 @@
@@ -1130,9 +1130,8 @@
INF("cmdline", S_IRUGO, pid_cmdline),
ONE("stat", S_IRUGO, tid_stat),
ONE("statm", S_IRUGO, pid_statm),
-diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
-new file mode 100644
-index ...fd57a55 100644
+Index: b/include/asm-generic/syscall.h
+===================================================================
--- /dev/null
+++ b/include/asm-generic/syscall.h
@@ -0,0 +1,141 @@
@@ -1277,8 +1276,8 @@
+ const unsigned long *args);
+
+#endif /* _ASM_SYSCALL_H */
-diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h
-index 2422ac6..05158b8 100644
+Index: b/include/asm-ia64/thread_info.h
+===================================================================
--- a/include/asm-ia64/thread_info.h
+++ b/include/asm-ia64/thread_info.h
@@ -85,9 +85,6 @@ struct thread_info {
@@ -1291,8 +1290,8 @@
#endif /* !__ASSEMBLY */
/*
-diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h
-index 6a3892d..33ec703 100644
+Index: b/include/asm-powerpc/ptrace.h
+===================================================================
--- a/include/asm-powerpc/ptrace.h
+++ b/include/asm-powerpc/ptrace.h
@@ -84,6 +84,7 @@ struct pt_regs {
@@ -1303,8 +1302,8 @@
#define regs_return_value(regs) ((regs)->gpr[3])
#ifdef CONFIG_SMP
-diff --git a/include/asm-powerpc/signal.h b/include/asm-powerpc/signal.h
-index a8c7bab..a7360cd 100644
+Index: b/include/asm-powerpc/signal.h
+===================================================================
--- a/include/asm-powerpc/signal.h
+++ b/include/asm-powerpc/signal.h
@@ -122,8 +122,7 @@ typedef struct sigaltstack {
@@ -1317,9 +1316,8 @@
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */
-diff --git a/include/asm-powerpc/syscall.h b/include/asm-powerpc/syscall.h
-new file mode 100644
-index ...174e1ad 100644
+Index: b/include/asm-powerpc/syscall.h
+===================================================================
--- /dev/null
+++ b/include/asm-powerpc/syscall.h
@@ -0,0 +1,73 @@
@@ -1396,8 +1394,8 @@
+}
+
+#endif /* _ASM_SYSCALL_H */
-diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h
-index e079e81..d0005e8 100644
+Index: b/include/asm-powerpc/thread_info.h
+===================================================================
--- a/include/asm-powerpc/thread_info.h
+++ b/include/asm-powerpc/thread_info.h
@@ -116,6 +116,7 @@ static inline struct thread_info *curren
@@ -1424,8 +1422,8 @@
#define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR)
/* Bits in local_flags */
-diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h
-index b163da7..91387fd 100644
+Index: b/include/asm-sparc64/ptrace.h
+===================================================================
--- a/include/asm-sparc64/ptrace.h
+++ b/include/asm-sparc64/ptrace.h
@@ -146,6 +146,7 @@ do { current_thread_info()->syscall_noer
@@ -1436,9 +1434,8 @@
#define regs_return_value(regs) ((regs)->u_regs[UREG_I0])
#ifdef CONFIG_SMP
extern unsigned long profile_pc(struct pt_regs *);
-diff --git a/include/asm-sparc64/syscall.h b/include/asm-sparc64/syscall.h
-new file mode 100644
-index ...c00fb1a 100644
+Index: b/include/asm-sparc64/syscall.h
+===================================================================
--- /dev/null
+++ b/include/asm-sparc64/syscall.h
@@ -0,0 +1,70 @@
@@ -1512,8 +1509,8 @@
+}
+
+#endif /* _ASM_SYSCALL_H */
-diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h
-index e5873e3..a4d0147 100644
+Index: b/include/asm-sparc64/thread_info.h
+===================================================================
--- a/include/asm-sparc64/thread_info.h
+++ b/include/asm-sparc64/thread_info.h
@@ -217,7 +217,7 @@ register struct thread_info *current_thr
@@ -1545,8 +1542,8 @@
/*
* Thread-synchronous status.
-diff --git a/include/asm-x86/ptrace.h b/include/asm-x86/ptrace.h
-index 9f922b0..555e8c9 100644
+Index: b/include/asm-x86/ptrace.h
+===================================================================
--- a/include/asm-x86/ptrace.h
+++ b/include/asm-x86/ptrace.h
@@ -211,6 +211,11 @@ static inline unsigned long frame_pointe
@@ -1561,9 +1558,8 @@
/*
* These are defined as per linux/ptrace.h, which see.
*/
-diff --git a/include/asm-x86/syscall.h b/include/asm-x86/syscall.h
-new file mode 100644
-index ...7de35f0 100644
+Index: b/include/asm-x86/syscall.h
+===================================================================
--- /dev/null
+++ b/include/asm-x86/syscall.h
@@ -0,0 +1,210 @@
@@ -1777,8 +1773,8 @@
+#endif /* CONFIG_X86_32 */
+
+#endif /* _ASM_SYSCALL_H */
-diff --git a/include/asm-x86/thread_info_32.h b/include/asm-x86/thread_info_32.h
-index 3267d9c..975e2b1 100644
+Index: b/include/asm-x86/thread_info_32.h
+===================================================================
--- a/include/asm-x86/thread_info_32.h
+++ b/include/asm-x86/thread_info_32.h
@@ -131,6 +131,7 @@ static inline struct thread_info *curren
@@ -1797,8 +1793,8 @@
#define _TIF_HRTICK_RESCHED (1 << TIF_HRTICK_RESCHED)
#define _TIF_DEBUG (1 << TIF_DEBUG)
#define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP)
-diff --git a/include/asm-x86/thread_info_64.h b/include/asm-x86/thread_info_64.h
-index a531e79..f1281a7 100644
+Index: b/include/asm-x86/thread_info_64.h
+===================================================================
--- a/include/asm-x86/thread_info_64.h
+++ b/include/asm-x86/thread_info_64.h
@@ -103,6 +103,7 @@ static inline struct thread_info *stack_
@@ -1826,8 +1822,8 @@
/* flags to check in __switch_to() */
#define _TIF_WORK_CTXSW \
-diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
-index f98501b..c6d85c5 100644
+Index: b/include/linux/ptrace.h
+===================================================================
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -117,6 +117,74 @@ static inline void ptrace_unlink(struct
@@ -1916,11 +1912,11 @@
#endif
#endif
-diff --git a/include/linux/sched.h b/include/linux/sched.h
-index 75145b7..c77eeb8 100644
+Index: b/include/linux/sched.h
+===================================================================
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1779,7 +1779,7 @@ extern int kill_pid_info_as_uid(int, str
+@@ -1783,7 +1783,7 @@ extern int kill_pid_info_as_uid(int, str
extern int kill_pgrp(struct pid *pid, int sig, int priv);
extern int kill_pid(struct pid *pid, int sig, int priv);
extern int kill_proc_info(int, struct siginfo *, pid_t);
@@ -1929,7 +1925,7 @@
extern void force_sig(int, struct task_struct *);
extern void force_sig_specific(int, struct task_struct *);
extern int send_sig(int, struct task_struct *, int);
-@@ -1866,9 +1866,13 @@ extern void set_task_comm(struct task_st
+@@ -1870,9 +1870,13 @@ extern void set_task_comm(struct task_st
extern char *get_task_comm(char *to, struct task_struct *tsk);
#ifdef CONFIG_SMP
@@ -1945,12 +1941,11 @@
#endif
#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks)
-diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
-new file mode 100644
-index ...61d4ca4 100644
+Index: b/include/linux/tracehook.h
+===================================================================
--- /dev/null
+++ b/include/linux/tracehook.h
-@@ -0,0 +1,575 @@
+@@ -0,0 +1,582 @@
+/*
+ * Tracing hooks
+ *
@@ -2016,7 +2011,7 @@
+ */
+static inline int tracehook_expect_breakpoints(struct task_struct *task)
+{
-+ return (task_ptrace(task) & PT_PTRACED);
++ return (task_ptrace(task) & PT_PTRACED) != 0;
+}
+
+/*
@@ -2164,7 +2159,7 @@
+ */
+static inline void tracehook_report_exit(long *exit_code)
+{
-+ ptrace_event(PT_TRACE_EXEC, PTRACE_EVENT_EXIT, *exit_code);
++ ptrace_event(PT_TRACE_EXIT, PTRACE_EVENT_EXIT, *exit_code);
+}
+
+/**
@@ -2197,7 +2192,7 @@
+ * tracehook_finish_clone - new child created and being attached
+ * @child: new child task
+ * @clone_flags: %CLONE_* flags from clone/fork/vfork system call
-+ * @trace: return value from tracehook_clone_prepare()
++ * @trace: return value from tracehook_prepare_clone()
+ *
+ * This is called immediately after adding @child to its parent's children list.
+ * The @trace value is that returned by tracehook_prepare_clone().
@@ -2212,19 +2207,20 @@
+
+/**
+ * tracehook_report_clone - in parent, new child is about to start running
-+ * @trace: return value from tracehook_clone_prepare()
++ * @trace: return value from tracehook_prepare_clone()
+ * @regs: parent's user register state
+ * @clone_flags: flags from parent's system call
+ * @pid: new child's PID in the parent's namespace
+ * @child: new child task
+ *
-+ * Called after a child is set up, but before it has been started running.
-+ * The @trace value is that returned by tracehook_clone_prepare().
-+ * This is not a good place to block, because the child has not started yet.
-+ * Suspend the child here if desired, and block in tracehook_clone_complete().
-+ * This must prevent the child from self-reaping if tracehook_clone_complete()
-+ * uses the @child pointer; otherwise it might have died and been released by
-+ * the time tracehook_report_clone_complete() is called.
++ * Called after a child is set up, but before it has been started
++ * running. @trace is the value returned by tracehook_prepare_clone().
++ * This is not a good place to block, because the child has not started
++ * yet. Suspend the child here if desired, and then block in
++ * tracehook_report_clone_complete(). This must prevent the child from
++ * self-reaping if tracehook_report_clone_complete() uses the @child
++ * pointer; otherwise it might have died and been released by the time
++ * tracehook_report_clone_complete() is called.
+ *
+ * Called with no locks held, but the child cannot run until this returns.
+ */
@@ -2232,7 +2228,7 @@
+ unsigned long clone_flags,
+ pid_t pid, struct task_struct *child)
+{
-+ if (unlikely(trace)) {
++ if (unlikely(trace) || unlikely(clone_flags & CLONE_PTRACE)) {
+ /*
+ * The child starts up with an immediate SIGSTOP.
+ */
@@ -2243,7 +2239,7 @@
+
+/**
+ * tracehook_report_clone_complete - new child is running
-+ * @trace: return value from tracehook_clone_prepare()
++ * @trace: return value from tracehook_prepare_clone()
+ * @regs: parent's user register state
+ * @clone_flags: flags from parent's system call
+ * @pid: new child's PID in the parent's namespace
@@ -2300,7 +2296,7 @@
+}
+
+/**
-+ * tracehook_finish_release_task - task is being reaped, clean up tracing
++ * tracehook_finish_release_task - final tracing clean-up
+ * @task: task in %EXIT_DEAD state
+ *
+ * This is called in release_task() when @task is being in the middle of
@@ -2352,7 +2348,7 @@
+ int sig,
+ void __user *handler)
+{
-+ return (task_ptrace(task) & PT_PTRACED);
++ return (task_ptrace(task) & PT_PTRACED) != 0;
+}
+
+/**
@@ -2373,7 +2369,7 @@
+ int sig,
+ void __user *handler)
+{
-+ return (task_ptrace(task) & PT_PTRACED);
++ return (task_ptrace(task) & PT_PTRACED) != 0;
+}
+
+/**
@@ -2439,14 +2435,20 @@
+ return notify || (current->ptrace & PT_PTRACED);
+}
+
++#define DEATH_REAP -1
++#define DEATH_DELAYED_GROUP_LEADER -2
++
+/**
+ * tracehook_notify_death - task is dead, ready to notify parent
+ * @task: @current task now exiting
+ * @death_cookie: value to pass to tracehook_report_death()
+ * @group_dead: nonzero if this was the last thread in the group to die
+ *
-+ * Return the signal number to send our parent with do_notify_parent(), or
-+ * zero to send no signal and leave a zombie, or -1 to self-reap right now.
++ * A return value >= 0 means call do_notify_parent() with that signal
++ * number. Negative return value can be %DEATH_REAP to self-reap right
++ * now, or %DEATH_DELAYED_GROUP_LEADER to a zombie without notifying our
++ * parent. Note that a return value of 0 means a do_notify_parent() call
++ * that sends no signal, but still wakes up a parent blocked in wait*().
+ *
+ * Called with write_lock_irq(&tasklist_lock) held.
+ */
@@ -2454,7 +2456,7 @@
+ void **death_cookie, int group_dead)
+{
+ if (task->exit_signal == -1)
-+ return task->ptrace ? SIGCHLD : -1;
++ return task->ptrace ? SIGCHLD : DEATH_REAP;
+
+ /*
+ * If something other than our normal parent is ptracing us, then
@@ -2464,21 +2466,21 @@
+ if (thread_group_empty(task) && !ptrace_reparented(task))
+ return task->exit_signal;
+
-+ return task->ptrace ? SIGCHLD : 0;
++ return task->ptrace ? SIGCHLD : DEATH_DELAYED_GROUP_LEADER;
+}
+
+/**
+ * tracehook_report_death - task is dead and ready to be reaped
+ * @task: @current task now exiting
-+ * @signal: signal number sent to parent, or 0 or -1
++ * @signal: return value from tracheook_notify_death()
+ * @death_cookie: value passed back from tracehook_notify_death()
+ * @group_dead: nonzero if this was the last thread in the group to die
+ *
+ * Thread has just become a zombie or is about to self-reap. If positive,
+ * @signal is the signal number just sent to the parent (usually %SIGCHLD).
-+ * If @signal is -1, this thread will self-reap. If @signal is 0, this is
-+ * a delayed_group_leader() zombie. The @death_cookie was passed back by
-+ * tracehook_notify_death().
++ * If @signal is %DEATH_REAP, this thread will self-reap. If @signal is
++ * %DEATH_DELAYED_GROUP_LEADER, this is a delayed_group_leader() zombie.
++ * The @death_cookie was passed back by tracehook_notify_death().
+ *
+ * If normal reaping is not inhibited, @task->exit_state might be changing
+ * in parallel.
@@ -2526,8 +2528,8 @@
+#endif /* TIF_NOTIFY_RESUME */
+
+#endif /* <linux/tracehook.h> */
-diff --git a/kernel/exit.c b/kernel/exit.c
-index fa7b700..a0225e2 100644
+Index: b/kernel/exit.c
+===================================================================
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -45,6 +45,7 @@
@@ -2582,7 +2584,7 @@
}
write_unlock_irq(&tasklist_lock);
-@@ -862,7 +860,8 @@ static void forget_original_parent(struc
+@@ -870,7 +868,8 @@ static void forget_original_parent(struc
*/
static void exit_notify(struct task_struct *tsk, int group_dead)
{
@@ -2592,7 +2594,7 @@
/*
* This does two things:
-@@ -899,22 +898,11 @@ static void exit_notify(struct task_stru
+@@ -907,22 +906,11 @@ static void exit_notify(struct task_stru
!capable(CAP_KILL))
tsk->exit_signal = SIGCHLD;
@@ -2613,14 +2615,14 @@
- state = EXIT_DEAD;
- tsk->exit_state = state;
+ signal = tracehook_notify_death(tsk, &cookie, group_dead);
-+ if (signal > 0)
++ if (signal >= 0)
+ signal = do_notify_parent(tsk, signal);
+
-+ tsk->exit_state = signal < 0 ? EXIT_DEAD : EXIT_ZOMBIE;
++ tsk->exit_state = signal == DEATH_REAP ? EXIT_DEAD : EXIT_ZOMBIE;
/* mt-exec, de_thread() is waiting for us */
if (thread_group_leader(tsk) &&
-@@ -924,8 +912,10 @@ static void exit_notify(struct task_stru
+@@ -932,8 +920,10 @@ static void exit_notify(struct task_stru
write_unlock_irq(&tasklist_lock);
@@ -2628,11 +2630,11 @@
+
/* If the process is dead, release it - nobody will wait for it */
- if (state == EXIT_DEAD)
-+ if (signal < 0)
++ if (signal == DEATH_REAP)
release_task(tsk);
}
-@@ -1004,10 +994,7 @@ NORET_TYPE void do_exit(long code)
+@@ -1012,10 +1002,7 @@ NORET_TYPE void do_exit(long code)
if (unlikely(!tsk->pid))
panic("Attempted to kill the idle task!");
@@ -2644,8 +2646,8 @@
/*
* We're taking recursive faults here in do_exit. Safest is to just
-diff --git a/kernel/fork.c b/kernel/fork.c
-index df8fe06..37b5be0 100644
+Index: b/kernel/fork.c
+===================================================================
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -54,6 +54,7 @@
@@ -2805,8 +2807,8 @@
}
} else {
nr = PTR_ERR(p);
-diff --git a/kernel/kthread.c b/kernel/kthread.c
-index bd1b9ea..1869162 100644
+Index: b/kernel/kthread.c
+===================================================================
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -176,7 +176,7 @@ void kthread_bind(struct task_struct *k,
@@ -2818,8 +2820,8 @@
set_task_cpu(k, cpu);
k->cpus_allowed = cpumask_of_cpu(cpu);
k->rt.nr_cpus_allowed = 1;
-diff --git a/kernel/ptrace.c b/kernel/ptrace.c
-index acf80a4..ef66127 100644
+Index: b/kernel/ptrace.c
+===================================================================
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -107,7 +107,7 @@ int ptrace_check_attach(struct task_stru
@@ -2831,8 +2833,8 @@
/* All systems go.. */
return ret;
-diff --git a/kernel/sched.c b/kernel/sched.c
-index 4e2f603..102d634 100644
+Index: b/kernel/sched.c
+===================================================================
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1765,16 +1765,24 @@ migrate_task(struct task_struct *p, int
@@ -2905,8 +2907,8 @@
}
/***
-diff --git a/kernel/signal.c b/kernel/signal.c
-index 6c0958e..44b5823 100644
+Index: b/kernel/signal.c
+===================================================================
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -22,6 +22,7 @@
@@ -3011,7 +3013,7 @@
/*
* This signal will be fatal to the whole group.
*/
-@@ -1343,9 +1348,11 @@ static inline void __wake_up_parent(stru
+@@ -1344,9 +1349,11 @@ static inline void __wake_up_parent(stru
/*
* Let a parent know about the death of a child.
* For a stopped/continued status change, use do_notify_parent_cldstop instead.
@@ -3025,7 +3027,7 @@
{
struct siginfo info;
unsigned long flags;
-@@ -1417,12 +1424,14 @@ void do_notify_parent(struct task_struct
+@@ -1418,12 +1425,14 @@ void do_notify_parent(struct task_struct
*/
tsk->exit_signal = -1;
if (psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN)
@@ -3041,7 +3043,7 @@
}
static void do_notify_parent_cldstop(struct task_struct *tsk, int why)
-@@ -1623,7 +1632,7 @@ finish_stop(int stop_count)
+@@ -1624,7 +1633,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.
*/
@@ -3050,7 +3052,7 @@
read_lock(&tasklist_lock);
do_notify_parent_cldstop(current, CLD_STOPPED);
read_unlock(&tasklist_lock);
-@@ -1760,6 +1769,9 @@ relock:
+@@ -1761,6 +1770,9 @@ relock:
signal->flags &= ~SIGNAL_CLD_MASK;
spin_unlock_irq(&sighand->siglock);
@@ -3060,7 +3062,7 @@
read_lock(&tasklist_lock);
do_notify_parent_cldstop(current->group_leader, why);
read_unlock(&tasklist_lock);
-@@ -1773,17 +1785,33 @@ relock:
+@@ -1774,17 +1786,33 @@ relock:
do_signal_stop(0))
goto relock;
@@ -3101,7 +3103,7 @@
if (ka->sa.sa_handler == SIG_IGN) /* Do nothing. */
continue;
if (ka->sa.sa_handler != SIG_DFL) {
-@@ -1831,7 +1859,7 @@ relock:
+@@ -1832,7 +1860,7 @@ relock:
spin_lock_irq(&sighand->siglock);
}
@@ -3110,7 +3112,7 @@
/* It released the siglock. */
goto relock;
}
-@@ -1852,7 +1880,7 @@ relock:
+@@ -1853,7 +1881,7 @@ relock:
if (sig_kernel_coredump(signr)) {
if (print_fatal_signals)
@@ -3119,7 +3121,7 @@
/*
* If it was able to dump core, this kills all
* other threads in the group and synchronizes with
-@@ -1861,13 +1889,13 @@ relock:
+@@ -1862,13 +1890,13 @@ relock:
* first and our do_group_exit call below will use
* that value and ignore the one we pass it.
*/
@@ -3135,7 +3137,7 @@
/* NOTREACHED */
}
spin_unlock_irq(&sighand->siglock);
-@@ -1909,7 +1937,7 @@ void exit_signals(struct task_struct *ts
+@@ -1910,7 +1938,7 @@ void exit_signals(struct task_struct *ts
out:
spin_unlock_irq(&tsk->sighand->siglock);
@@ -3144,7 +3146,7 @@
read_lock(&tasklist_lock);
do_notify_parent_cldstop(tsk, CLD_STOPPED);
read_unlock(&tasklist_lock);
-@@ -1921,7 +1949,6 @@ EXPORT_SYMBOL_GPL(dequeue_signal);
+@@ -1922,7 +1950,6 @@ EXPORT_SYMBOL_GPL(dequeue_signal);
EXPORT_SYMBOL(flush_signals);
EXPORT_SYMBOL(force_sig);
EXPORT_SYMBOL(kill_proc);
@@ -3152,7 +3154,7 @@
EXPORT_SYMBOL(send_sig);
EXPORT_SYMBOL(send_sig_info);
EXPORT_SYMBOL(sigprocmask);
-@@ -2325,7 +2352,7 @@ int do_sigaction(int sig, struct k_sigac
+@@ -2326,7 +2353,7 @@ int do_sigaction(int sig, struct k_sigac
* (for example, SIGCHLD), shall cause the pending signal to
* be discarded, whether or not it is blocked"
*/
@@ -3161,8 +3163,8 @@
sigemptyset(&mask);
sigaddset(&mask, sig);
rm_from_queue_full(&mask, &t->signal->shared_pending);
-diff --git a/lib/Makefile b/lib/Makefile
-index 74b0cfb..62dfd16 100644
+Index: b/lib/Makefile
+===================================================================
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -72,6 +72,8 @@ lib-$(CONFIG_GENERIC_BUG) += bug.o
@@ -3174,9 +3176,8 @@
hostprogs-y := gen_crc32table
clean-files := crc32table.h
-diff --git a/lib/syscall.c b/lib/syscall.c
-new file mode 100644
-index ...a4f7067 100644
+Index: b/lib/syscall.c
+===================================================================
--- /dev/null
+++ b/lib/syscall.c
@@ -0,0 +1,75 @@
@@ -3255,8 +3256,8 @@
+ return 0;
+}
+EXPORT_SYMBOL_GPL(task_current_syscall);
-diff --git a/mm/nommu.c b/mm/nommu.c
-index 4462b6a..5edccd9 100644
+Index: b/mm/nommu.c
+===================================================================
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -22,7 +22,7 @@
@@ -3277,8 +3278,8 @@
vm_flags &= ~VM_MAYSHARE;
return vm_flags;
-diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
-index 1c864c0..f92c6af 100644
+Index: b/security/selinux/hooks.c
+===================================================================
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -24,7 +24,7 @@
linux-2.6-utrace.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.70 -r 1.71 linux-2.6-utrace.patch
Index: linux-2.6-utrace.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-utrace.patch,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- linux-2.6-utrace.patch 19 Sep 2008 13:37:24 -0000 1.70
+++ linux-2.6-utrace.patch 15 Oct 2008 20:42:34 -0000 1.71
@@ -1,20 +1,20 @@
- Documentation/DocBook/Makefile | 2 +-
- Documentation/DocBook/utrace.tmpl | 21 +
- Documentation/utrace.txt | 579 ++++++++++
- fs/proc/array.c | 3 +
- include/linux/ptrace.h | 15 +
- include/linux/sched.h | 6 +
- include/linux/tracehook.h | 60 +
- include/linux/utrace.h | 534 +++++++++
- init/Kconfig | 28 +
- kernel/Makefile | 1 +
- kernel/ptrace.c | 542 +++++++++-
- kernel/signal.c | 14 +-
- kernel/utrace.c | 2222 +++++++++++++++++++++++++++++++++++++
- 13 files changed, 4023 insertions(+), 4 deletions(-)
+---
+ Documentation/DocBook/Makefile | 2
+ Documentation/DocBook/utrace.tmpl | 566 ++++++++
+ fs/proc/array.c | 3
+ include/linux/ptrace.h | 21
+ include/linux/sched.h | 6
+ include/linux/tracehook.h | 68
+ include/linux/utrace.h | 707 ++++++++++
+ init/Kconfig | 26
+ kernel/Makefile | 1
+ kernel/ptrace.c | 612 ++++++++
+ kernel/signal.c | 14
+ kernel/utrace.c | 2609 ++++++++++++++++++++++++++++++++++++++
+ 12 files changed, 4627 insertions(+), 8 deletions(-)
-diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
-index 0eb0d02..49a78b7 100644
+Index: b/Documentation/DocBook/Makefile
+===================================================================
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -7,7 +7,7 @@
@@ -26,620 +26,579 @@
procfs-guide.xml writing_usb_driver.xml networking.xml \
kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
-diff --git a/Documentation/DocBook/utrace.tmpl b/Documentation/DocBook/utrace.tmpl
-new file mode 100644
-index ...8dfaa91 100644
+Index: b/Documentation/DocBook/utrace.tmpl
+===================================================================
--- /dev/null
+++ b/Documentation/DocBook/utrace.tmpl
-@@ -0,0 +1,21 @@
+@@ -0,0 +1,566 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
-+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
++"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
+
+<book id="utrace">
-+ <bookinfo>
-+ <title>The utrace User Debugging Infrastructure</title>
-+ </bookinfo>
++ <bookinfo>
++ <title>The utrace User Debugging Infrastructure</title>
++ </bookinfo>
++
++ <toc></toc>
++
++ <chapter id="concepts"><title>utrace concepts</title>
++
++ <sect1 id="intro"><title>Introduction</title>
++
++ <para>
++ <application>utrace</application> is infrastructure code for tracing
++ and controlling user threads. This is the foundation for writing
++ tracing engines, which can be loadable kernel modules.
++ </para>
++
++ <para>
++ The basic actors in <application>utrace</application> are the thread
++ and the tracing engine. A tracing engine is some body of code that
++ calls into the <filename><linux/utrace.h></filename>
++ interfaces, represented by a <structname>struct
++ utrace_engine_ops</structname>. (Usually it's a kernel module,
++ though the legacy <function>ptrace</function> support is a tracing
++ engine that is not in a kernel module.) The interface operates on
++ individual threads (<structname>struct task_struct</structname>).
++ If an engine wants to treat several threads as a group, that is up
++ to its higher-level code.
++ </para>
++
++ <para>
++ Tracing begins by attaching an engine to a thread, using
++ <function>utrace_attach_task</function> or
++ <function>utrace_attach_pid</function>. If successful, it returns a
++ pointer that is the handle used in all other calls.
++ </para>
++
++ </sect1>
++
++ <sect1 id="callbacks"><title>Events and Callbacks</title>
++
++ <para>
++ An attached engine does nothing by default. An engine makes something
++ happen by requesting callbacks via <function>utrace_set_events</function>
++ and poking the thread with <function>utrace_control</function>.
++ The synchronization issues related to these two calls
++ are discussed further below in <xref linkend="teardown"/>.
++ </para>
++
++ <para>
++ Events are specified using the macro
++ <constant>UTRACE_EVENT(<replaceable>type</replaceable>)</constant>.
++ Each event type is associated with a callback in <structname>struct
++ utrace_engine_ops</structname>. A tracing engine can leave unused
++ callbacks <constant>NULL</constant>. The only callbacks required
++ are those used by the event flags it sets.
++ </para>
++
++ <para>
++ Many engines can be attached to each thread. When a thread has an
++ event, each engine gets a callback if it has set the event flag for
++ that event type. Engines are called in the order they attached.
++ </para>
++
++ <para>
++ Event reporting callbacks have details particular to the event type,
++ but are all called in similar environments and have the same
++ constraints. Callbacks are made from safe points, where no locks
++ are held, no special resources are pinned (usually), and the
++ user-mode state of the thread is accessible. So, callback code has
++ a pretty free hand. But to be a good citizen, callback code should
++ never block for long periods. It is fine to block in
++ <function>kmalloc</function> and the like, but never wait for i/o or
++ for user mode to do something. If you need the thread to wait, use
++ <constant>UTRACE_STOP</constant> and return from the callback
++ quickly. When your i/o finishes or whatever, you can use
++ <function>utrace_control</function> to resume the thread.
++ </para>
++
++ </sect1>
++
++ <sect1 id="safely"><title>Stopping Safely</title>
++
++ <sect2 id="well-behaved"><title>Writing well-behaved callbacks</title>
++
++ <para>
++ Well-behaved callbacks are important to maintain two essential
++ properties of the interface. The first of these is that unrelated
++ tracing engines should not interfere with each other. If your engine's
++ event callback does not return quickly, then another engine won't get
++ the event notification in a timely manner. The second important
++ property is that tracing should be as noninvasive as possible to the
++ normal operation of the system overall and of the traced thread in
++ particular. That is, attached tracing engines should not perturb a
++ thread's behavior, except to the extent that changing its user-visible
++ state is explicitly what you want to do. (Obviously some perturbation
++ is unavoidable, primarily timing changes, ranging from small delays due
++ to the overhead of tracing, to arbitrary pauses in user code execution
++ when a user stops a thread with a debugger for examination.) Even when
++ you explicitly want the perturbation of making the traced thread block,
++ just blocking directly in your callback has more unwanted effects. For
++ example, the <constant>CLONE</constant> event callbacks are called when
++ the new child thread has been created but not yet started running; the
++ child can never be scheduled until the <constant>CLONE</constant>
++ tracing callbacks return. (This allows engines tracing the parent to
++ attach to the child.) If a <constant>CLONE</constant> event callback
++ blocks the parent thread, it also prevents the child thread from
++ running (even to process a <constant>SIGKILL</constant>). If what you
++ want is to make both the parent and child block, then use
++ <function>utrace_attach_task</function> on the child and then use
++ <constant>UTRACE_STOP</constant> on both threads. A more crucial
++ problem with blocking in callbacks is that it can prevent
++ <constant>SIGKILL</constant> from working. A thread that is blocking
++ due to <constant>UTRACE_STOP</constant> will still wake up and die
++ immediately when sent a <constant>SIGKILL</constant>, as all threads
++ should. Relying on the <application>utrace</application>
++ infrastructure rather than on private synchronization calls in event
++ callbacks is an important way to help keep tracing robustly
++ noninvasive.
++ </para>
++
++ </sect2>
++
++ <sect2 id="UTRACE_STOP"><title>Using <constant>UTRACE_STOP</constant></title>
++
++ <para>
++ To control another thread and access its state, it must be stopped
++ with <constant>UTRACE_STOP</constant>. This means that it is
++ stopped and won't start running again while we access it. When a
++ thread is not already stopped, <function>utrace_control</function>
++ returns <constant>-EINPROGRESS</constant> and an engine must wait
++ for an event callback when the thread is ready to stop. The thread
++ may be running on another CPU or may be blocked. When it is ready
++ to be examined, it will make callbacks to engines that set the
[...6042 lines suppressed...]
++ if (IS_ERR(engine))
++ return engine;
++ if (likely(!ptrace_update_utrace(child, engine)))
++ return engine;
++ ptrace_detach_utrace(child, engine);
++ utrace_engine_put(engine);
++ return ERR_PTR(-ESRCH);
++}
++
++int ptrace_check_attach(struct task_struct *child, int kill)
++{
++ struct utrace_attached_engine *engine;
++ struct utrace_examiner exam;
++ int ret;
++
++ engine = utrace_attach_task(child, UTRACE_ATTACH_MATCH_OPS,
++ &ptrace_utrace_ops, NULL);
++ if (IS_ERR(engine))
++ return -ESRCH;
++
++ /*
++ * Make sure our engine has already stopped the child.
++ * Then wait for it to be off the CPU.
++ */
++ ret = 0;
++ if (utrace_control(child, engine, UTRACE_STOP) ||
++ utrace_prepare_examine(child, engine, &exam))
++ ret = -ESRCH;
++
++ utrace_engine_put(engine);
++
++ return ret;
++}
++
++#endif /* !CONFIG_UTRACE_PTRACE */
++
+ int __ptrace_may_attach(struct task_struct *task)
+ {
+ /* May we inspect the given task?
+@@ -156,6 +666,7 @@ int ptrace_attach(struct task_struct *ta
+ {
+ int retval;
+ unsigned long flags;
++ struct utrace_attached_engine *engine;
+
+ audit_ptrace(task);
+
+@@ -163,6 +674,13 @@ int ptrace_attach(struct task_struct *ta
+ if (same_thread_group(task, current))
+ goto out;
+
++ engine = ptrace_attach_utrace(task);
++ if (unlikely(IS_ERR(engine))) {
++ if (PTR_ERR(engine) == -ESRCH)
++ retval = -ESRCH;
++ goto out;
++ }
++
+ repeat:
+ /*
+ * Nasty, nasty.
+@@ -202,6 +720,11 @@ repeat:
+ bad:
+ write_unlock_irqrestore(&tasklist_lock, flags);
+ task_unlock(task);
++ if (!IS_ERR(engine)) {
++ if (retval)
++ ptrace_detach_utrace(task, engine);
++ utrace_engine_put(engine);
++ }
+ out:
+ return retval;
+ }
+@@ -221,9 +744,7 @@ int ptrace_detach(struct task_struct *ch
+ if (!valid_signal(data))
+ return -EIO;
+
+- /* Architecture-specific hardware disable .. */
+- ptrace_disable(child);
+- clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
++ ptrace_detach_task(child);
+
+ write_lock_irq(&tasklist_lock);
+ /* protect against de_thread()->release_task() */
+@@ -309,6 +830,8 @@ static int ptrace_setoptions(struct task
+ if (data & PTRACE_O_TRACEEXIT)
+ child->ptrace |= PT_TRACE_EXIT;
+
++ ptrace_update_utrace(child, NULL);
++
+ return (data & ~PTRACE_O_MASK) ? -EINVAL : 0;
+ }
+
+@@ -367,6 +890,7 @@ static int ptrace_setsiginfo(struct task
+ #define is_sysemu_singlestep(request) 0
+ #endif
+
++#ifndef CONFIG_UTRACE_PTRACE
+ static int ptrace_resume(struct task_struct *child, long request, long data)
+ {
+ if (!valid_signal(data))
+@@ -401,6 +925,76 @@ static int ptrace_resume(struct task_str
+
+ return 0;
+ }
++#else /* CONFIG_UTRACE_PTRACE */
++static int ptrace_resume(struct task_struct *child, long request, long data)
++{
++ struct utrace_attached_engine *engine;
++ enum utrace_resume_action action;
++ enum utrace_syscall_action syscall;
++ int ret = 0;
++
++ if (!valid_signal(data))
++ return -EIO;
++
++ engine = utrace_attach_task(child, UTRACE_ATTACH_MATCH_OPS,
++ &ptrace_utrace_ops, NULL);
++ if (IS_ERR(engine))
++ return -ESRCH;
++
++ syscall = UTRACE_SYSCALL_RUN;
++#ifdef PTRACE_SYSEMU
++ if (request == PTRACE_SYSEMU || request == PTRACE_SYSEMU_SINGLESTEP)
++ syscall = UTRACE_SYSCALL_ABORT;
++#endif
++
++ if (syscall != UTRACE_SYSCALL_RUN || request == PTRACE_SYSCALL) {
++ if (!(engine->flags & UTRACE_EVENT_SYSCALL) &&
++ utrace_set_events(child, engine,
++ engine->flags | UTRACE_EVENT_SYSCALL))
++ ret = -ESRCH;
++ } else if (engine->flags & UTRACE_EVENT(SYSCALL_ENTRY)) {
++ if (utrace_set_events(child, engine,
++ engine->flags & ~UTRACE_EVENT_SYSCALL))
++ ret = -ESRCH;
++ }
++
++ action = UTRACE_RESUME;
++ if (is_singleblock(request)) {
++ if (unlikely(!arch_has_block_step()))
++ ret = -EIO;
++ action = UTRACE_BLOCKSTEP;
++ } else if (is_singlestep(request) || is_sysemu_singlestep(request)) {
++ if (unlikely(!arch_has_single_step()))
++ ret = -EIO;
++ action = UTRACE_SINGLESTEP;
++ }
++
++ if (!ret) {
++ child->exit_code = data;
++
++ ptrace_set_action(child, action, syscall);
++
++ if (task_is_stopped(child)) {
++ spin_lock_irq(&child->sighand->siglock);
++ child->signal->flags &= ~SIGNAL_STOP_STOPPED;
++ spin_unlock_irq(&child->sighand->siglock);
++ }
++
++ /*
++ * To resume with a signal we must hit ptrace_report_signal.
++ */
++ if (data)
++ action = UTRACE_INTERRUPT;
++
++ if (utrace_control(child, engine, action))
++ ret = -ESRCH;
++ }
++
++ utrace_engine_put(engine);
++
++ return ret;
++}
++#endif /* !CONFIG_UTRACE_PTRACE */
+
+ int ptrace_request(struct task_struct *child, long request,
+ long addr, long data)
+@@ -480,6 +1074,11 @@ int ptrace_request(struct task_struct *c
+ int ptrace_traceme(void)
+ {
+ int ret = -EPERM;
++ struct utrace_attached_engine *engine;
++
++ engine = ptrace_attach_utrace(current);
++ if (unlikely(IS_ERR(engine)))
++ return ret;
+
+ /*
+ * Are we already being traced?
+@@ -513,6 +1112,9 @@ repeat:
+ write_unlock_irqrestore(&tasklist_lock, flags);
+ }
+ task_unlock(current);
++ if (ret)
++ ptrace_detach_utrace(current, engine);
++ utrace_engine_put(engine);
+ return ret;
+ }
+
More information about the fedora-extras-commits
mailing list