linux-stable-rt/arch/x86_64/kernel
Jim Keniston 8bf1101bd5 [PATCH] kprobes: Fix return probes on sys_execve
Fix a bug in kprobes that can cause an Oops or even a crash when a return
probe is installed on one of the following functions: sys_execve,
do_execve, load_*_binary, flush_old_exec, or flush_thread.  The fix is to
remove the call to kprobe_flush_task() in flush_thread().  This fix has
been tested on all architectures for which the return-probes feature has
been implemented (i386, x86_64, ppc64, ia64).  Please apply.

BACKGROUND

Up to now, we have called kprobe_flush_task() under two situations: when a
task exits, and when it execs.  Flushing kretprobe_instances on exit is
correct because (a) do_exit() doesn't return, and (b) one or more
return-probed functions may be active when a task calls do_exit().  Neither
is the case for sys_execve() and its callees.

Initially, the mistaken call to kprobe_flush_task() on exec was harmless
because we put the "real" return address of each active probed function
back in the stack, just to be safe, when we recycled its
kretprobe_instance.  When support for ppc64 and ia64 was added, this safety
measure couldn't be employed, and was eventually dropped even for i386 and
x86_64.  sys_execve() and its callees were informally blacklisted for
return probes until this fix was developed.

Acked-by: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Signed-off-by: Jim Keniston <jkenisto@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-23 16:08:39 -08:00
..
acpi
cpufreq
Makefile [PATCH] x86_64: Support for AMD specific MCE Threshold. 2005-11-14 19:55:13 -08:00
aperture.c [PATCH] x86_64: Fix gcc 4 warning in aperture.c 2005-11-14 19:55:14 -08:00
apic.c [PATCH] x86_64: Support for AMD specific MCE Threshold. 2005-11-14 19:55:13 -08:00
asm-offsets.c
crash.c
e820.c [PATCH] x86_64: Only use asm/sections.h to declare section symbols 2005-11-14 19:55:14 -08:00
early_printk.c
entry.S [PATCH] x86_64: Support for AMD specific MCE Threshold. 2005-11-14 19:55:13 -08:00
genapic.c
genapic_cluster.c
genapic_flat.c
head.S [PATCH] x86_64: Unmap NULL during early bootup 2005-11-14 19:55:14 -08:00
head64.c [PATCH] x86_64: Only use asm/sections.h to declare section symbols 2005-11-14 19:55:14 -08:00
i387.c
i8259.c Merge x86-64 update from Andi 2005-11-14 19:56:02 -08:00
init_task.c
io_apic.c [PATCH] i386/x86-64: Share interrupt vectors when there is a large number of interrupt sources 2005-11-14 19:55:13 -08:00
ioport.c
irq.c
kprobes.c [PATCH] Kprobes: preempt_disable/enable() simplification 2005-11-07 07:53:46 -08:00
ldt.c
machine_kexec.c
mce.c [PATCH] x86_64: Log machine checks from boot on Intel systems 2005-11-14 19:55:17 -08:00
mce_amd.c [PATCH] x86_64: Support for AMD specific MCE Threshold. 2005-11-14 19:55:13 -08:00
mce_intel.c
module.c
mpparse.c [PATCH] x86_64: Increase the maximum number of local APICs to the maximum 2005-11-14 19:55:17 -08:00
nmi.c
pci-dma.c
pci-gart.c [PATCH] x86_64: Use the DMA32 zone for dma_alloc_coherent()/pci_alloc_consistent 2005-11-14 19:55:14 -08:00
pci-nommu.c
pmtimer.c
process.c [PATCH] kprobes: Fix return probes on sys_execve 2005-11-23 16:08:39 -08:00
ptrace.c [PATCH] consolidate sys_ptrace() 2005-11-07 07:53:42 -08:00
reboot.c [PATCH] x86_64: Reduce number of retries for reset through keyboard controller 2005-11-14 19:55:16 -08:00
relocate_kernel.S
setup.c [PATCH] x86_64: Fix sparse mem 2005-11-14 19:55:18 -08:00
setup64.c [PATCH] x86_64: Unmap NULL during early bootup 2005-11-14 19:55:14 -08:00
signal.c [PATCH] x86_64: Save/restore CS in 64bit signal handlers and force __USER_CS for CS 2005-11-14 19:55:15 -08:00
smp.c [PATCH] x86_64: Don't enable interrupt unconditionally in reboot path 2005-11-14 19:55:16 -08:00
smpboot.c Merge x86-64 update from Andi 2005-11-14 19:56:02 -08:00
suspend.c
suspend_asm.S
sys_x86_64.c [PATCH] x86_64: Use common sys_time64 2005-11-14 19:55:17 -08:00
syscall.c
time.c
trampoline.S
traps.c [PATCH] x86_64: Remove CONFIG_CHECKING and add command line option for pagefault tracing 2005-11-14 19:55:17 -08:00
vmlinux.lds.S [PATCH] x86_64: Only use asm/sections.h to declare section symbols 2005-11-14 19:55:14 -08:00
vsyscall.c
x8664_ksyms.c [PATCH] x86_64: Allow modular build of ia32 aout loader 2005-11-14 19:55:16 -08:00