Module Name:    src
Committed By:   maxv
Date:           Tue Feb 14 09:03:48 UTC 2017

Modified Files:
        src/sys/arch/amd64/amd64: netbsd32_machdep.c

Log Message:
Check %eip with USER_LDT too.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/amd64/amd64/netbsd32_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.102 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.103
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.102	Thu Feb  9 08:38:25 2017
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Tue Feb 14 09:03:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.102 2017/02/09 08:38:25 maxv Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.103 2017/02/14 09:03:48 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.102 2017/02/09 08:38:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.103 2017/02/14 09:03:48 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1064,10 +1064,11 @@ cpu_mcontext32_validate(struct lwp *l, c
 		if (!VALID_USER_DSEL32(gr[_REG32_DS]) ||
 		    !VALID_USER_DSEL32(gr[_REG32_SS]))
 			return EINVAL;
-		if (gr[_REG32_EIP] >= VM_MAXUSER_ADDRESS32)
-			return EINVAL;
 	}
 
+	if (gr[_REG32_EIP] >= VM_MAXUSER_ADDRESS32)
+		return EINVAL;
+
 	return 0;
 }
 

Reply via email to