From: Roland McGrath <roland@redhat.com>

In 2.4, strace will show you all bogus system calls a process tries.  In
2.6, it only shows you stubs < __NR_syscalls, and there is no tracing stop
for large bogus system call numbers.  I can't see why this was changed, so
I am assuming it was accidental.

This patch restores the expected behavior that syscall tracing shows every
bogus syscall attempt.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/i386/kernel/entry.S |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -puN arch/i386/kernel/entry.S~i386-syscall-tracing-of-bogus-system-calls arch/i386/kernel/entry.S
--- 25/arch/i386/kernel/entry.S~i386-syscall-tracing-of-bogus-system-calls	2004-09-02 15:52:58.033372464 -0700
+++ 25-akpm/arch/i386/kernel/entry.S	2004-09-02 15:52:58.038371704 -0700
@@ -269,11 +269,11 @@ sysenter_past_esp:
 	pushl %eax
 	SAVE_ALL
 	GET_THREAD_INFO(%ebp)
-	cmpl $(nr_syscalls), %eax
-	jae syscall_badsys
 
 	testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
 	jnz syscall_trace_entry
+	cmpl $(nr_syscalls), %eax
+	jae syscall_badsys
 	call *sys_call_table(,%eax,4)
 	movl %eax,EAX(%esp)
 	cli
@@ -292,11 +292,11 @@ ENTRY(system_call)
 	pushl %eax			# save orig_eax
 	SAVE_ALL
 	GET_THREAD_INFO(%ebp)
-	cmpl $(nr_syscalls), %eax
-	jae syscall_badsys
 					# system call tracing in operation
 	testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
 	jnz syscall_trace_entry
+	cmpl $(nr_syscalls), %eax
+	jae syscall_badsys
 syscall_call:
 	call *sys_call_table(,%eax,4)
 	movl %eax,EAX(%esp)		# store the return value
_