9c64cfe56c
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 |
||
---|---|---|
.. | ||
freebsd32_capability.c | ||
freebsd32_ioctl.c | ||
freebsd32_ioctl.h | ||
freebsd32_ipc.h | ||
freebsd32_misc.c | ||
freebsd32_misc.h | ||
freebsd32_proto.h | ||
freebsd32_signal.h | ||
freebsd32_syscall.h | ||
freebsd32_syscalls.c | ||
freebsd32_sysent.c | ||
freebsd32_systrace_args.c | ||
freebsd32_util.h | ||
freebsd32.h | ||
Makefile | ||
syscalls.conf | ||
syscalls.master |