Bug 212639 - kernel/386: i386_set_ldt/i386_ldt_grow run out of LDT, because M_ZERO missing in user_ldt_alloc?
Summary: kernel/386: i386_set_ldt/i386_ldt_grow run out of LDT, because M_ZERO missin...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: i386 Any
: --- Affects Some People
Assignee: Tijl Coosemans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-13 03:19 UTC by David NewHamlet
Modified: 2016-10-10 11:58 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David NewHamlet 2016-09-13 03:19:07 UTC
Go compiler crash with "signal: trace/BPT trap" when running testing concurrently(and lead to heavy load).

Core-dump and kernel debug log telling that it is trigger by i386_set_ldt/i386_ldt_grow run out of LDT.

Fix by change kmem_malloc flags from "M_WAITOK" to "M_WAITOK | M_ZERO" in user_ldt_alloc 
(https://github.com/freebsd/freebsd/blob/master/sys/i386/i386/sys_machdep.c#L441)

More detail:
https://github.com/golang/go/issues/16950
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-09-25 18:30:01 UTC
A commit references this bug:

Author: tijl
Date: Sun Sep 25 18:29:03 UTC 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

Changes:
  head/sys/i386/i386/sys_machdep.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-10-10 11:52:40 UTC
A commit references this bug:

Author: tijl
Date: Mon Oct 10 11:51:47 UTC 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

Changes:
_U  stable/11/
  stable/11/sys/i386/i386/sys_machdep.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-10-10 11:54:42 UTC
A commit references this bug:

Author: tijl
Date: Mon Oct 10 11:53:54 UTC 2016
New revision: 306961
URL: https://svnweb.freebsd.org/changeset/base/306961

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

Changes:
_U  stable/10/
  stable/10/sys/i386/i386/sys_machdep.c