summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-05-30 18:59:37 +0000
committerneel <neel@FreeBSD.org>2014-05-30 18:59:37 +0000
commitaefe217075d85adc7bb877c26e3aa7daa54e0274 (patch)
tree70e8393c368be3b39e4b77ce2855dd0f126dc911
parent0b964e71baf2f648ec150259bb531537126dce2c (diff)
downloadFreeBSD-src-aefe217075d85adc7bb877c26e3aa7daa54e0274.zip
FreeBSD-src-aefe217075d85adc7bb877c26e3aa7daa54e0274.tar.gz
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
-rw-r--r--sys/amd64/amd64/sys_machdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c
index 1d9bd4c..a7420b7 100644
--- a/sys/amd64/amd64/sys_machdep.c
+++ b/sys/amd64/amd64/sys_machdep.c
@@ -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);
OpenPOWER on IntegriCloud