linux/include
David S. Miller 8acfe468b0 net: Limit socket I/O iovec total length to INT_MAX.
This helps protect us from overflow issues down in the
individual protocol sendmsg/recvmsg handlers.  Once
we hit INT_MAX we truncate out the rest of the iovec
by setting the iov_len members to zero.

This works because:

1) For SOCK_STREAM and SOCK_SEQPACKET sockets, partial
   writes are allowed and the application will just continue
   with another write to send the rest of the data.

2) For datagram oriented sockets, where there must be a
   one-to-one correspondance between write() calls and
   packets on the wire, INT_MAX is going to be far larger
   than the packet size limit the protocol is going to
   check for and signal with -EMSGSIZE.

Based upon a patch by Linus Torvalds.

Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-28 11:47:52 -07:00
..
acpi ACPI: Fix typos 2010-09-28 21:38:19 -04:00
asm-generic Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2010-10-22 19:59:04 -07:00
crypto Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-10-24 13:41:39 -07:00
drm drm/ttm: Fix two race conditions + fix busy codepaths 2010-10-06 09:04:43 +10:00
keys
linux net: Limit socket I/O iovec total length to INT_MAX. 2010-10-28 11:47:52 -07:00
math-emu
media V4L/DVB: videobuf-dma-sg: set correct size in last sg element 2010-09-27 22:22:01 -03:00
mtd
net fib: Fix fib zone and its hash leak on namespace stop 2010-10-28 10:27:03 -07:00
pcmcia pcmcia: IOCARD is also required for using IRQs 2010-10-22 08:46:36 +02:00
rdma
rxrpc
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2010-10-22 20:30:48 -07:00
sound driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices 2010-10-22 10:16:43 -07:00
trace Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2010-10-22 17:13:10 -07:00
video Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-10-24 13:41:39 -07:00
xen xen: pvhvm: make it clearer that XEN_UNPLUG_* define bits in a bitfield 2010-08-23 12:01:35 +01:00
Kbuild