svn commit: r267598 - stable/10/sys/amd64/amd64

Neel Natu neel at FreeBSD.org
Tue Jun 17 21:49:04 UTC 2014


Author: neel
Date: Tue Jun 17 21:49:03 2014
New Revision: 267598
URL: http://svnweb.freebsd.org/changeset/base/267598

Log:
  MFC r266901
  Allocate a zeroed LDT.
  Failing to do this might result in the LDT appearing to run out of free
  descriptors because of random junk in the descriptor's 'sd_type' field.

Modified:
  stable/10/sys/amd64/amd64/sys_machdep.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- stable/10/sys/amd64/amd64/sys_machdep.c	Tue Jun 17 21:48:04 2014	(r267597)
+++ stable/10/sys/amd64/amd64/sys_machdep.c	Tue Jun 17 21:49:03 2014	(r267598)
@@ -465,7 +465,7 @@ user_ldt_alloc(struct proc *p, int force
 	new_ldt = malloc(sizeof(struct proc_ldt), M_SUBPROC, M_WAITOK);
 	new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena,
 	     max_ldt_segment * sizeof(struct user_segment_descriptor),
-	     M_WAITOK);
+	     M_WAITOK | M_ZERO);
 	if (new_ldt->ldt_base == NULL) {
 		FREE(new_ldt, M_SUBPROC);
 		mtx_lock(&dt_lock);


More information about the svn-src-stable mailing list