linux/arch/powerpc
Ananth N Mavinakayanahalli 83db3dde26 [POWERPC] kprobes: Fix possible system crash during out-of-line single-stepping
- On archs that have no-exec support, we vmalloc() a executable scratch
area of PAGE_SIZE and divide it up into an array of slots of maximum
instruction size for that arch
- On a kprobe registration, the original instruction is copied to the
first available free slot, so if multiple kprobes are registered, chances
are, they get contiguous slots
- On POWER4, due to not having coherent icaches, we could hit a situation
where a probe that is registered on one processor, is hit immediately on
another. This second processor could have fetched the stream of text from
the out-of-line single-stepping area *before* the probe registration
completed, possibly due to an earlier (and a different) kprobe hit and
hence would see stale data at the slot.

Executing such an arbitrary instruction lead to a problem as reported
in LTC bugzilla 23555.

The correct solution is to call flush_icache_range() as soon as the
instruction is copied for out-of-line single-stepping, so the correct
instruction is seen on all processors.

Thanks to Will Schmidt who tracked this down.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Will Schmidt <will_schmidt@vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-08-17 16:41:10 +10:00
..
boot Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2006-06-22 22:11:30 -07:00
configs [POWERPC] update {g5,iseries,pseries}_defconfigs 2006-08-17 16:41:10 +10:00
kernel [POWERPC] kprobes: Fix possible system crash during out-of-line single-stepping 2006-08-17 16:41:10 +10:00
lib Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
math-emu Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mm [POWERPC] Fix mem= handling when the memory limit is > RMO size 2006-07-26 01:28:24 +10:00
oprofile [PATCH] oprofile: Fix unnecessary cleverness 2006-06-26 09:58:17 -07:00
platforms [POWERPC] Fix might-sleep warning on removing cpus 2006-08-08 16:00:11 +10:00
sysdev [PATCH] powerpc: fix MPIC OF tree parsing on Apple quad g5 2006-07-10 13:24:20 -07:00
xmon Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Kconfig [POWERPC] Add cpufreq support for Xserve G5 2006-07-28 10:51:43 +10:00
Kconfig.debug [POWERPC] Add udbg support for RTAS console 2006-06-28 11:59:48 +10:00
Makefile [POWERPC] Remove stale 64bit on 32bit kernel code 2006-06-15 19:31:26 +10:00