Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Oct 2016 11:51:47 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r306960 - stable/11/sys/i386/i386
Message-ID:  <201610101151.u9ABplsw052788@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Mon Oct 10 11:51:47 2016
New Revision: 306960
URL: https://svnweb.freebsd.org/changeset/base/306960

Log:
  MFC: r306318
  
  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

Modified:
  stable/11/sys/i386/i386/sys_machdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/i386/i386/sys_machdep.c
==============================================================================
--- stable/11/sys/i386/i386/sys_machdep.c	Mon Oct 10 11:49:43 2016	(r306959)
+++ stable/11/sys/i386/i386/sys_machdep.c	Mon Oct 10 11:51:47 2016	(r306960)
@@ -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?201610101151.u9ABplsw052788>