FreeBSD src
Go to file
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
bin Call sync consistently using atf_check 2015-10-06 01:00:12 +00:00
cddl Have lockstat(1) trace locks by name rather than by address. 2015-09-30 05:46:56 +00:00
contrib Add std::uncaught_exceptions() to libcxxrt (C++17, see N4152 and N4259). 2015-10-05 17:47:23 +00:00
crypto Fix OpenSSH multiple vulnerabilities by backporting three changes 2015-08-25 20:48:37 +00:00
etc Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.7.0 2015-10-06 17:53:29 +00:00
gnu Replace most of the beforeinstall: hack with FILES mechanism. 2015-09-30 20:47:27 +00:00
include Mute this cookie as well 2015-10-03 17:28:46 +00:00
kerberos5 Add more SUBDIR_PARALLEL. 2015-09-26 14:13:51 +00:00
lib Fix core corruption caused by race in note_procstat_vmmap 2015-10-06 18:07:00 +00:00
libexec Annotate arm userspace assembler sources stating their tolerance to 2015-09-29 16:09:58 +00:00
release Document r288669, stack protector "strong" level. 2015-10-06 17:42:31 +00:00
rescue META_MODE: Remove DEP_MACHINE from Makefile.depend files. 2015-09-25 19:44:01 +00:00
sbin Fix possible segmentation fault. 2015-10-03 03:12:57 +00:00
secure Replace afterinstall: hack from r111083 with 'make delete-old' functionality. 2015-09-19 03:46:10 +00:00
share Fix core corruption caused by race in note_procstat_vmmap 2015-10-06 18:07:00 +00:00
sys Fix core corruption caused by race in note_procstat_vmmap 2015-10-06 18:07:00 +00:00
targets All the games moved to usr.bin/ in r288485. 2015-10-02 17:58:16 +00:00
tests Use _exit() instead of exit() in child processes created during tests. 2015-09-09 22:54:07 +00:00
tools Merge ^/head r288197 through r288456. 2015-10-01 19:02:45 +00:00
usr.bin Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.7.0 2015-10-06 17:53:29 +00:00
usr.sbin Reallocate a maxlen-long buffer only when the current maxlen is 2015-10-06 08:43:48 +00:00
.arcconfig Add repository.callsign, to help arcanist figure out what repo it's 2015-07-02 22:23:52 +00:00
.arclint phabricator related changes: 2015-04-20 20:33:22 +00:00
COPYRIGHT Bump copyright year. 2014-12-31 10:00:43 +00:00
LOCKS Explicitly require Security Officer's approval for kernel PRNG bits. 2013-09-17 14:19:05 +00:00
MAINTAINERS Remove cokane@ from MAINTAINERS for 3dfx(4)/tdfx(4) because their email 2014-11-25 05:25:12 +00:00
Makefile Fix the .MAKE added in r251750 to properly support the historical -n -n. 2015-09-29 18:57:30 +00:00
Makefile.inc1 The latest version of lex requires the latest m4 to build, add a dependency 2015-10-05 17:45:13 +00:00
ObsoleteFiles.inc Update dates in UPDATING and ObsoleteFiles.inc. 2015-10-06 16:26:07 +00:00
README README: changes and fixups 2015-04-19 07:16:44 +00:00
UPDATING Update dates in UPDATING and ObsoleteFiles.inc. 2015-10-06 16:26:07 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree.  See build(7)
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The `buildkernel` and `installkernel` targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process.  See build(7), config(8),
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
for more information.

Note: If you want to build and install the kernel with the
`buildkernel` and `installkernel` targets, you might need to build
world before.  More information is available in the handbook.

The kernel configuration files reside in the sys/<arch>/conf
sub-directory.  GENERIC is the default configuration used in release builds.
NOTES contains entries and documentation for all possible
devices, not just those commonly used.


Source Roadmap:
---------------

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html