Resent-Date: Tue, 5 Oct 1999 14:29:10 +0200 (MET DST)
Sender: labr@ubi.se
Date: Tue, 05 Oct 1999 14:28:45 +0200
From: lars brinkhoff <lars.brinkhoff@intermec.com>
X-Accept-Language: en
To: linux-m68k@lists.linux-m68k.org
Subject: PATCH: syscall change patch, part II
Resent-From: linux-m68k@phil.uni-sb.de

Here is the second part of the patch needed to enable ptrace()
to change the system call number of a process.

--- linux-2.3.16/arch/m68k/kernel/ptrace.c.orig	Tue Oct  5 14:20:38 1999
+++ linux-2.3.16/arch/m68k/kernel/ptrace.c	Tue Oct  5 14:24:07 1999
@@ -19,6 +19,7 @@
 #include <linux/ptrace.h>
 #include <linux/user.h>
 #include <linux/config.h>
+#include <linux/sys.h>
 
 #include <asm/uaccess.h>
 #include <asm/page.h>
@@ -416,7 +417,8 @@
 
 			addr = addr >> 2; /* temporary hack. */
 			    
-			if (addr == PT_ORIG_D0)
+			if (addr == PT_ORIG_D0 &&
+			    (data >= NR_syscalls || data < 0))
 				goto out;
 			if (addr == PT_SR) {
 				data &= SR_MASK;

