summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-06-17 21:49:03 +0000
committerneel <neel@FreeBSD.org>2014-06-17 21:49:03 +0000
commit13424f9f51add0a3df94b2ed4303d5f455209c60 (patch)
tree92e05a040e6cf15520f6e7203c95bc1c24219ce8
parent652a2c3d9a45b8fbf725ab5be85182201c9b9477 (diff)
downloadFreeBSD-src-13424f9f51add0a3df94b2ed4303d5f455209c60.zip
FreeBSD-src-13424f9f51add0a3df94b2ed4303d5f455209c60.tar.gz
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.
-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 81ac0e3..36d9f08 100644
--- a/sys/amd64/amd64/sys_machdep.c
+++ b/sys/amd64/amd64/sys_machdep.c
@@ -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);
OpenPOWER on IntegriCloud