freebsd kernel with SKQ
Go to file
Gleb Smirnoff 9c64cfe56c The sendfile(2) allows to send extra data from userspace before the file
data (headers).  Historically the size of the headers was not checked
against the socket buffer space.  Application could easily overcommit the
socket buffer space.

With the new sendfile (r293439) the problem remained, but a KASSERT was
inserted that checked that amount of data written to the socket matches
its space.  In case when size of headers is bigger that socket space,
KASSERT fires.  Without INVARIANTS the new sendfile won't panic, but
would report incorrect amount of bytes sent.

o With this change, the headers copyin is moved down into the cycle, after
  the sbspace() check.  The uio size is trimmed by socket space there,
  which fixes the overcommit problem and its consequences.
o The compatibility handling for FreeBSD 4 sendfile headers API is pushed
  up the stack to syscall wrappers.  This required a copy and paste of the
  code, but in turn this allowed to remove extra stack carried parameter
  from fo_sendfile_t, and embrace entire compat code into #ifdef.  If in
  future we got more fo_sendfile_t function, the copy and paste level would
  even reduce.

Reviewed by:	emax, gallatin, Maxim Dounin <mdounin mdounin.ru>
Tested by:	Vitalij Satanivskij <satan ukr.net>
Sponsored by:	Netflix
2016-03-29 19:57:11 +00:00
bin sh: Fix use-after-free if a trap replaces itself. 2016-03-28 18:58:40 +00:00
cddl libdtrace: use calloc(3) instead of malloc(3) when it makes sense. 2016-03-14 00:34:12 +00:00
contrib Pull in r255683 from upstream libc++ trunk (by Eric Fiselier): 2016-03-27 21:20:43 +00:00
crypto Re-add AES-CBC ciphers to the default cipher list on the server. 2016-03-11 00:23:10 +00:00
etc pf: Friendly error message for status if pf.ko is not loaded 2016-03-27 17:22:27 +00:00
gnu DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
include For C++, expose long long types and functions (lldiv_t, llabs, lldiv, 2016-03-23 19:17:12 +00:00
kerberos5 We don't have a CPPFLAGS, COPTS or CPUFLAGS. 2016-03-26 03:46:04 +00:00
lib Fix parsing of a 1GB page table entry. 2016-03-28 18:41:48 +00:00
libexec Do not override top level CFLAGS in libexec/dma 2016-03-27 23:19:14 +00:00
release Add paragraph about isp(4) improvements. 2016-03-17 09:04:07 +00:00
rescue Fix the build after ifconfig was converted over to lib80211 in r291470 2015-11-30 16:34:13 +00:00
sbin Fix bunch of .Xrs. 2016-03-28 16:48:28 +00:00
secure Upgrade to OpenSSH 7.2p2. 2016-03-11 00:15:29 +00:00
share Reword descriptions of asserting locks held without WITNESS. 2016-03-29 16:07:51 +00:00
sys The sendfile(2) allows to send extra data from userspace before the file 2016-03-29 19:57:11 +00:00
targets DIRDEPS_BUILD: Update dependencies. 2016-03-21 18:02:26 +00:00
tests Use a SKIP testplan instead of bailing out if/when the tester isn't 2016-03-22 08:12:45 +00:00
tools Remove tools/vt/setfont 2016-03-21 20:51:35 +00:00
usr.bin Add phttpget(8) .Xr to fetch(1). 2016-03-29 11:56:00 +00:00
usr.sbin Adjust misleading wording of the -G option and simplify a few 2016-03-28 02:05:35 +00:00
.arcconfig
.arclint
COPYRIGHT Bump copyright year. 2015-12-31 11:21:45 +00:00
LOCKS
MAINTAINERS Add myself to MAINTAINERS. 2016-03-14 16:27:43 +00:00
Makefile Import bmake-20160315 2016-03-18 17:27:26 +00:00
Makefile.inc1 simplify compile-time default keyboard map generation 2016-03-28 19:51:45 +00:00
Makefile.libcompat Fix libcompat not handling some external toolchain flags. 2016-03-25 19:12:44 +00:00
ObsoleteFiles.inc Forgot lib32 libdevinfo.so.5 2016-03-18 02:59:10 +00:00
README Vendor import of OpenSSH 7.2p1. 2016-03-10 20:10:25 +00:00
UPDATING Use uintmax_t (typedef'd to rman_res_t type) for rman ranges. 2016-03-18 01:28:41 +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