Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Sep 2016 18:29:03 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r306318 - head/sys/i386/i386
Message-ID:  <201609251829.u8PIT33V046702@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Sun Sep 25 18:29:02 2016
New Revision: 306318
URL: https://svnweb.freebsd.org/changeset/base/306318

Log:
  MFamd64: 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.
  
  http://lists.freebsd.org/pipermail/freebsd-amd64/2014-May/016088.html
  
  PR:		212639
  Submitted by:	wheelcomplex@gmail.com
  MFC after:	2 weeks

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

Modified: head/sys/i386/i386/sys_machdep.c
==============================================================================
--- head/sys/i386/i386/sys_machdep.c	Sun Sep 25 17:58:55 2016	(r306317)
+++ head/sys/i386/i386/sys_machdep.c	Sun Sep 25 18:29:02 2016	(r306318)
@@ -438,7 +438,7 @@ user_ldt_alloc(struct mdproc *mdp, int l
 
 	new_ldt->ldt_len = len = NEW_MAX_LD(len);
 	new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena,
-	    len * sizeof(union descriptor), M_WAITOK);
+	    len * sizeof(union descriptor), M_WAITOK | M_ZERO);
 	new_ldt->ldt_refcnt = 1;
 	new_ldt->ldt_active = 0;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609251829.u8PIT33V046702>