--- linux/arch/i386/kernel/entry.S 2005-04-12 09:47:38.000000000 +0400 +++ linux/arch/i386/kernel/entry.S 2005-04-12 11:51:49.000000000 +0400 @@ -253,24 +253,15 @@ cli # make sure we don't miss an interrupt # setting need_resched or sigpending # between sampling and the iret +#ifdef CONFIG_TRAP_BAD_SYSCALL_EXITS + movl %esp, %eax # pt_regs pointer + call sys_call_exit +#endif movl TI_flags(%ebp), %ecx testw $_TIF_ALLWORK_MASK, %cx # current->work jne syscall_exit_work restore_all: -#ifdef CONFIG_TRAP_BAD_SYSCALL_EXITS - movl EFLAGS(%esp), %eax # mix EFLAGS and CS - movb CS(%esp), %al - testl $(VM_MASK | 3), %eax - jz resume_kernelX # returning to kernel or vm86-space - - cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ? - jz resume_kernelX - - int $3 - -resume_kernelX: -#endif movl EFLAGS(%esp), %eax # mix EFLAGS, SS and CS movb OLDSS(%esp), %ah movb CS(%esp), %al --- linux/arch/i386/kernel/kgdb_stub.c 2005-04-12 09:47:38.000000000 +0400 +++ linux/arch/i386/kernel/kgdb_stub.c 2005-04-12 13:23:57.000000000 +0400 @@ -2135,18 +2135,16 @@ #endif #undef regs #ifdef CONFIG_TRAP_BAD_SYSCALL_EXITS -asmlinkage void -bad_sys_call_exit(int stuff) +fastcall void sys_call_exit(struct pt_regs *regs) { - struct pt_regs *regs = (struct pt_regs *) &stuff; - printk("Sys call %d return with %x preempt_count\n", - (int) regs->orig_eax, preempt_count()); + if (preempt_count()) + printk("Sys call %d return with %x preempt_count\n", + (int) regs->orig_eax, preempt_count()); } #endif #ifdef CONFIG_STACK_OVERFLOW_TEST #include -asmlinkage void -stack_overflow(void) +fastcall void stack_overflow(void) { #ifdef BREAKPOINT BREAKPOINT;