]> git.karo-electronics.de Git - karo-tx-linux.git/commit
tcp: Fix >4GB writes on 64-bit.
authorDavid S. Miller <davem@davemloft.net>
Tue, 28 Sep 2010 03:24:54 +0000 (20:24 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 29 Oct 2010 04:44:07 +0000 (21:44 -0700)
commit237a9f8f234fde5441f1102b8820b8425f4c1e16
tree4955937bab9f283dd172fa97831ae04e00ff0651
parent0a3f7a263b2b89e285e173073f15f70da5396063
tcp: Fix >4GB writes on 64-bit.

[ Upstream commit 01db403cf99f739f86903314a489fb420e0e254f ]

Fixes kernel bugzilla #16603

tcp_sendmsg() truncates iov_len to an 'int' which a 4GB write to write
zero bytes, for example.

There is also the problem higher up of how verify_iovec() works.  It
wants to prevent the total length from looking like an error return
value.

However it does this using 'int', but syscalls return 'long' (and
thus signed 64-bit on 64-bit machines).  So it could trigger
false-positives on 64-bit as written.  So fix it to use 'long'.

Reported-by: Olaf Bonorden <bono@onlinehome.de>
Reported-by: Daniel Büse <dbuese@gmx.de>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/socket.h
net/core/iovec.c
net/ipv4/tcp.c