kernel_optimize_test/arch/avr32/kernel
Haavard Skinnemoen 325d6f5593 avr32: Fix OCD refcounting bug
Iff the parent has TIF_DEBUG set, _and_ clone_flags includes
CLONE_PTRACE we should set the TIF_DEBUG flag for the child and
increment the ocd refcount. Otherwise, the TIF_DEBUG flag must be
unset.

Currently, the child inherits TIF_DEBUG from the parent before
copy_thread is called, so TIF_DEBUG may be already be set before we
determine whether the child is supposed to inherit debugging
capabilities from the parent or not. This means that ocd_enable()
won't increment the refcount, because TIF_DEBUG is already set, and
that TIF_DEBUG will be set for processes that aren't being debugged.

This leads to a refcounting asymmetry, which may show up as

------------[ cut here ]------------
Badness at arch/avr32/kernel/ocd.c:73
PC is at ocd_disable+0x34/0x60
LR is at put_lock_stats+0xa/0x20

as reported by David Brownell. Happens when strace'ing a process that
forks a new child process, e.g. "strace mount -tjffs2 mtd1 /mnt", and
subsequently killing the child process (e.g. "umount /mnt".)

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-02-27 14:23:53 +01:00
..
asm-offsets.c [AVR32] Follow the rules when dealing with the OCD system 2007-12-07 14:54:46 +01:00
avr32_ksyms.c [AVR32] Export clear_page symbol 2007-01-26 13:12:25 +01:00
cpu.c [AVR32] constify function pointer tables 2008-01-25 08:31:43 +01:00
entry-avr32b.S [AVR32] Fix wrong pt_regs in critical exception handler 2007-12-07 14:54:48 +01:00
head.S AVR32: Get rid of board_early_init 2006-11-06 10:43:23 +01:00
init_task.c [PATCH] avr32 architecture 2006-09-26 08:48:54 -07:00
irq.c [AVR32] NMI debugging 2008-01-25 08:31:43 +01:00
kprobes.c [AVR32] Enable debugging only when needed 2008-01-25 08:31:39 +01:00
Makefile [AVR32] NMI debugging 2008-01-25 08:31:43 +01:00
module.c [AVR32] Clean up exception handling code 2007-04-27 13:44:13 +02:00
nmi_debug.c [AVR32] NMI debugging 2008-01-25 08:31:43 +01:00
ocd.c libfs: allow error return from simple attributes 2008-02-08 09:22:34 -08:00
process.c avr32: Fix OCD refcounting bug 2008-02-27 14:23:53 +01:00
ptrace.c [AVR32] Enable debugging only when needed 2008-01-25 08:31:39 +01:00
semaphore.c [PATCH] avr32 architecture 2006-09-26 08:48:54 -07:00
setup.c Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
signal.c [AVR32] Remove redundant try_to_freeze() call from do_signal() 2008-01-25 08:31:39 +01:00
stacktrace.c [AVR32] Implement stacktrace support 2007-12-07 14:52:36 +01:00
switch_to.S [PATCH] avr32 architecture 2006-09-26 08:48:54 -07:00
sys_avr32.c [PATCH] AVR32: Implement kernel_execve 2006-10-02 07:57:24 -07:00
syscall_table.S Fix timerfd breakage on avr32 2008-02-05 14:37:15 -08:00
syscall-stubs.S AVR32: Wire up sys_epoll_pwait 2006-11-06 14:07:15 +01:00
time.c Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
traps.c [AVR32] NMI debugging 2008-01-25 08:31:43 +01:00
vmlinux.lds.S all archs: consolidate init and exit sections in vmlinux.lds.h 2008-01-28 23:21:17 +01:00