gvisor/pkg/tcpip/transport/tcp
Michael Pratt ddb34b3690 Enforce message size limits and avoid host calls with too many iovecs
Currently, in the face of FileMem fragmentation and a large sendmsg or
recvmsg call, host sockets may pass > 1024 iovecs to the host, which
will immediately cause the host to return EMSGSIZE.

When we detect this case, use a single intermediate buffer to pass to
the kernel, copying to/from the src/dst buffer.

To avoid creating unbounded intermediate buffers, enforce message size
checks and truncation w.r.t. the send buffer size. The same
functionality is added to netstack unix sockets for feature parity.

PiperOrigin-RevId: 216590198
Change-Id: I719a32e71c7b1098d5097f35e6daf7dd5190eff7
2018-10-10 14:10:17 -07:00
..
testing/context Always pass buffer.VectorisedView by value 2018-09-12 21:57:55 -07:00
BUILD Prevent TCP connect from picking bound ports 2018-09-17 20:44:04 -07:00
accept.go netstack: make listening tcp socket close state setting and cleanup atomic. 2018-08-23 16:14:46 -07:00
connect.go Block for link address resolution 2018-09-28 11:00:16 -07:00
cubic.go Expose TCP RTT 2018-09-04 12:39:47 -07:00
dual_stack_test.go Switch netstack licenses to Apache 2.0. 2018-07-09 14:04:40 -07:00
endpoint.go Block for link address resolution 2018-09-28 11:00:16 -07:00
endpoint_state.go Enforce message size limits and avoid host calls with too many iovecs 2018-10-10 14:10:17 -07:00
forwarder.go Always pass buffer.VectorisedView by value 2018-09-12 21:57:55 -07:00
protocol.go Always pass buffer.VectorisedView by value 2018-09-12 21:57:55 -07:00
rcv.go Automated rollback of changelist 207037226 2018-08-02 10:42:48 -07:00
reno.go Cubic implementation for Netstack. 2018-08-03 17:54:42 -07:00
sack.go Switch netstack licenses to Apache 2.0. 2018-07-09 14:04:40 -07:00
segment.go Always pass buffer.VectorisedView by value 2018-09-12 21:57:55 -07:00
segment_heap.go Switch netstack licenses to Apache 2.0. 2018-07-09 14:04:40 -07:00
segment_queue.go Automated rollback of changelist 207037226 2018-08-02 10:42:48 -07:00
segment_state.go netstack: tcp socket connected state S/R support. 2018-07-10 09:23:35 -07:00
snd.go Fix RTT estimation when timestamp option is enabled. 2018-09-19 09:59:12 -07:00
snd_state.go Automated rollback of changelist 207037226 2018-08-02 10:42:48 -07:00
tcp_sack_test.go Switch netstack licenses to Apache 2.0. 2018-07-09 14:04:40 -07:00
tcp_test.go Block for link address resolution 2018-09-28 11:00:16 -07:00
tcp_timestamp_test.go Block for link address resolution 2018-09-28 11:00:16 -07:00
timer.go Switch netstack licenses to Apache 2.0. 2018-07-09 14:04:40 -07:00