svn commit: r266901 - head/sys/amd64/amd64

Neel Natu neel at FreeBSD.org
Fri May 30 18:59:38 UTC 2014


Author: neel
Date: Fri May 30 18:59:37 2014
New Revision: 266901
URL: http://svnweb.freebsd.org/changeset/base/266901

Log:
  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.
  
  http://lists.freebsd.org/pipermail/freebsd-amd64/2014-May/016088.html
  
  Reviewed by:	kib
  MFC after:	2 weeks

Modified:
  head/sys/amd64/amd64/sys_machdep.c

Modified: head/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- head/sys/amd64/amd64/sys_machdep.c	Fri May 30 18:14:15 2014	(r266900)
+++ head/sys/amd64/amd64/sys_machdep.c	Fri May 30 18:59:37 2014	(r266901)
@@ -462,7 +462,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-all mailing list