Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/amd64 Check %eip with USER_LDT too.



details:   https://anonhg.NetBSD.org/src/rev/56767f28ed4e
branches:  trunk
changeset: 821714:56767f28ed4e
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Feb 14 09:03:48 2017 +0000

description:
Check %eip with USER_LDT too.

diffstat:

 sys/arch/amd64/amd64/netbsd32_machdep.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r c70dd9123886 -r 56767f28ed4e sys/arch/amd64/amd64/netbsd32_machdep.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c   Tue Feb 14 09:00:03 2017 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c   Tue Feb 14 09:03:48 2017 +0000
@@ -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 @@
                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;
 }
 



Home | Main Index | Thread Index | Old Index