Module Name: src Committed By: maxv Date: Sat Oct 21 08:27:19 UTC 2017
Modified Files: src/sys/arch/x86/x86: sys_machdep.c Log Message: Forbid 64bit entries. That's it, now we support USER_LDT on amd64. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/x86/x86/sys_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/x86/x86/sys_machdep.c diff -u src/sys/arch/x86/x86/sys_machdep.c:1.42 src/sys/arch/x86/x86/sys_machdep.c:1.43 --- src/sys/arch/x86/x86/sys_machdep.c:1.42 Sat Oct 21 06:55:54 2017 +++ src/sys/arch/x86/x86/sys_machdep.c Sat Oct 21 08:27:19 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_machdep.c,v 1.42 2017/10/21 06:55:54 maxv Exp $ */ +/* $NetBSD: sys_machdep.c,v 1.43 2017/10/21 08:27:19 maxv Exp $ */ /* * Copyright (c) 1998, 2007, 2009, 2017 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.42 2017/10/21 06:55:54 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.43 2017/10/21 08:27:19 maxv Exp $"); #include "opt_mtrr.h" #include "opt_pmc.h" @@ -249,6 +249,11 @@ x86_set_ldt1(struct lwp *l, struct x86_s for (i = 0; i < ua->num; i++) { union descriptor *desc = &descv[i]; +#ifdef __x86_64__ + if (desc->sd.sd_long != 0) + return EACCES; +#endif + switch (desc->sd.sd_type) { case SDT_SYSNULL: desc->sd.sd_p = 0;