PERFORCE change 77425 for review

Peter Wemm peter at FreeBSD.org
Tue May 24 23:28:58 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=77425

Change 77425 by peter at peter_melody on 2005/05/24 23:28:19

	Only allow 32 bit ptrace clients to connect to 32 bit targets.
	Otherwise they cannot see the full register context.  64 bit gdb
	can debug 32 bit targets, but not the other way around.

Affected files ...

.. //depot/projects/hammer/sys/kern/sys_process.c#26 edit

Differences ...

==== //depot/projects/hammer/sys/kern/sys_process.c#26 (text+ko) ====

@@ -380,8 +380,7 @@
 #ifdef COMPAT_IA32
 	int wrap32 = 0;
 
-	if (td->td_proc->p_sysent == &ia32_freebsd_sysvec &&
-	    curthread->td_proc->p_sysent == &ia32_freebsd_sysvec)
+	if (td->td_proc->p_sysent == &ia32_freebsd_sysvec)
 		wrap32 = 1;
 #endif
 	addr = &r;
@@ -539,9 +538,13 @@
 	}
 
 #ifdef COMPAT_IA32
-	if (td->td_proc->p_sysent == &ia32_freebsd_sysvec &&
-	    td2->td_proc->p_sysent == &ia32_freebsd_sysvec)
+	if (td->td_proc->p_sysent == &ia32_freebsd_sysvec) {
+		if (td2->td_proc->p_sysent != &ia32_freebsd_sysvec) {
+			error = EINVAL;
+			goto fail;
+		}
 		wrap32 = 1;
+	}
 #endif
 	/*
 	 * Permissions check


More information about the p4-projects mailing list