diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2015-10-15 12:25:00 -0500 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2017-03-17 11:02:33 +0100 |
commit | fd65507644435f46c41efd5def2712bd5a61e22b (patch) | |
tree | 96fc6f9e44bb4b28bd78eff44b8023cbb4261c54 /net/ipv4 | |
parent | 1f19ffb5170347ac667f6cc3450b30fcd72b054c (diff) | |
download | kernel_samsung_espresso10-fd65507644435f46c41efd5def2712bd5a61e22b.zip kernel_samsung_espresso10-fd65507644435f46c41efd5def2712bd5a61e22b.tar.gz kernel_samsung_espresso10-fd65507644435f46c41efd5def2712bd5a61e22b.tar.bz2 |
net: add length argument to skb_copy_and_csum_datagram_iovec
Without this length argument, we can read past the end of the iovec in
memcpy_toiovec because we have no way of knowing the total length of the
iovec's buffers.
This is needed for stable kernels where 89c22d8c3b27 ("net: Fix skb
csum races when peeking") has been backported but that don't have the
ioviter conversion, which is almost all the stable trees <= 3.18.
This also fixes a kernel crash for NFS servers when the client uses
-onfsvers=3,proto=udp to mount the export.
Change-Id: I1865e3d7a1faee42a5008a9ad58c4d3323ea4bab
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
(cherry picked from commit c91234366e4cfd4f70c73e7d79ede92a6e462a88)
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/tcp_input.c | 2 | ||||
-rw-r--r-- | net/ipv4/udp.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index c91002f..5e39dbe 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -5123,7 +5123,7 @@ static int tcp_copy_to_iovec(struct sock *sk, struct sk_buff *skb, int hlen) err = skb_copy_datagram_iovec(skb, hlen, tp->ucopy.iov, chunk); else err = skb_copy_and_csum_datagram_iovec(skb, hlen, - tp->ucopy.iov); + tp->ucopy.iov, chunk); if (!err) { tp->ucopy.len -= chunk; diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 24c7f52..cecc679 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1209,7 +1209,7 @@ try_again: else { err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), - msg->msg_iov); + msg->msg_iov, copied); if (err == -EINVAL) goto csum_copy_err; |