[PATCH] Allow ptrace to modify system call numbers

Jeff Dike (jdike@karaya.com)
Thu, 19 Aug 1999 14:32:40 -0400


diff -Naur -X ../exclude-files orig/arch/i386/kernel/entry.S
um/arch/i386/kernel/entry.S
--- orig/arch/i386/kernel/entry.S Sat Aug 7 22:42:11 1999
+++ um/arch/i386/kernel/entry.S Thu Aug 19 13:19:32 1999
@@ -214,9 +214,11 @@
movl $-ENOSYS,EAX(%esp)
call SYMBOL_NAME(syscall_trace)
movl ORIG_EAX(%esp),%eax
+ cmpl $(NR_syscalls),%eax
+ jae 1f
call *SYMBOL_NAME(sys_call_table)(,%eax,4)
movl %eax,EAX(%esp) # save the return value
- call SYMBOL_NAME(syscall_trace)
+1: call SYMBOL_NAME(syscall_trace)
jmp ret_from_sys_call
badsys:
movl $-ENOSYS,EAX(%esp)
diff -Naur -X ../exclude-files orig/arch/i386/kernel/ptrace.c
um/arch/i386/kernel/ptrace.c
--- orig/arch/i386/kernel/ptrace.c Sat Aug 7 22:46:11 1999
+++ um/arch/i386/kernel/ptrace.c Tue Aug 3 13:43:42 1999
@@ -73,7 +73,9 @@
{
switch (regno >> 2) {
case ORIG_EAX:
- return -EIO;
+ if (value >= NR_syscalls)
+ return -EIO;
+ break;
case FS:
if (value && (value & 3) != 3)
return -EIO;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/