freebsd-dev/share
Conrad Meyer e6b95927f3 Fix core corruption caused by race in note_procstat_vmmap
This fix is spiritually similar to r287442 and was discovered thanks to
the KASSERT added in that revision.

NT_PROCSTAT_VMMAP output length, when packing kinfo structs, is tied to
the length of filenames corresponding to vnodes in the process' vm map
via vn_fullpath.  As vnodes may move during coredump, this is racy.

We do not remove the race, only prevent it from causing coredump
corruption.

- Add a sysctl, kern.coredump_pack_vmmapinfo, to allow users to disable
  kinfo packing for PROCSTAT_VMMAP notes.  This avoids VMMAP corruption
  and truncation, even if names change, at the cost of up to PATH_MAX
  bytes per mapped object.  The new sysctl is documented in core.5.

- Fix note_procstat_vmmap to self-limit in the second pass.  This
  addresses corruption, at the cost of sometimes producing a truncated
  result.

- Fix PROCSTAT_VMMAP consumers libutil (and libprocstat, via copy-paste)
  to grok the new zero padding.

Reported by:	pho (https://people.freebsd.org/~pho/stress/log/datamove4-2.txt)
Relnotes:	yes
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3824
2015-10-06 18:07:00 +00:00
..
colldef Add META_MODE support. 2015-06-13 19:20:56 +00:00
dict Add META_MODE support. 2015-06-13 19:20:56 +00:00
doc META_MODE: Remove DEP_MACHINE from Makefile.depend files. 2015-09-25 19:44:01 +00:00
dtrace Add a little, but very useful script for use with programs that work using an 2015-10-04 00:40:12 +00:00
examples Join excessive split lines. 2015-09-30 12:40:51 +00:00
i18n new depends 2015-06-16 23:37:19 +00:00
keys Remove scary comment about this being a test key. 2014-01-13 20:55:15 +00:00
man Fix core corruption caused by race in note_procstat_vmmap 2015-10-06 18:07:00 +00:00
me Add META_MODE support. 2015-06-13 19:20:56 +00:00
misc jhg -> jgh 2015-09-05 01:00:02 +00:00
mk Merge ^/head r288836 through r288925. 2015-10-06 16:25:13 +00:00
mklocale Add META_MODE support. 2015-06-13 19:20:56 +00:00
monetdef Add META_MODE support. 2015-06-13 19:20:56 +00:00
msgdef Remove rm -Rf beforeinstall hack that was needed due to a change that 2015-09-18 22:55:18 +00:00
numericdef Add META_MODE support. 2015-06-13 19:20:56 +00:00
security META_MODE: Remove DEP_MACHINE from Makefile.depend files. 2015-09-25 19:44:01 +00:00
sendmail Add META_MODE support. 2015-06-13 19:20:56 +00:00
skel Add META_MODE support. 2015-06-13 19:20:56 +00:00
snmp Add META_MODE support. 2015-06-13 19:20:56 +00:00
syscons Add META_MODE support. 2015-06-13 19:20:56 +00:00
tabset Add META_MODE support. 2015-06-13 19:20:56 +00:00
termcap Add META_MODE support. 2015-06-13 19:20:56 +00:00
tests Add some sample test programs. 2013-11-18 12:57:46 +00:00
timedef Add META_MODE support. 2015-06-13 19:20:56 +00:00
vt Add double size 16x32 VGA ROM font 2015-09-25 02:52:54 +00:00
zoneinfo Fix build when LEAPSECONDS is enabled. 2015-08-22 07:41:28 +00:00
Makefile Only build share/dtrace if MK_CDDL != no 2015-01-25 00:32:17 +00:00
Makefile.inc