--- linux-2.6.13/include/asm-i386/processor.h.orig 2005-09-01 11:19:22.000000000 +0800 +++ linux-2.6.13/include/asm-i386/processor.h 2005-09-01 11:26:04.000000000 +0800 @@ -538,11 +538,13 @@ unsigned long *__ptr = (unsigned long *)(info); \ (unsigned long)(&__ptr[THREAD_SIZE_LONGS]); \ }) - +/* + * subtract 8 here, to skip dummy offset, see copy_thread() for detailed comment. + */ #define task_pt_regs(task) \ ({ \ struct pt_regs *__regs__; \ - __regs__ = (struct pt_regs *)KSTK_TOP((task)->thread_info); \ + __regs__ = (struct pt_regs *)(KSTK_TOP((task)->thread_info)-8); \ __regs__ - 1; \ })