aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-08-11 21:54:48 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:32:08 +0200
commit8558623a83dc5bb686534553877d102b4e1a3504 (patch)
treee123d5ee90478a732a1cf7b38af11049f0fc1d8e /net
parent5d3005a1584cd506cdc9e6a914d83e4484dc71d8 (diff)
af_unix: fix bug on large send()
commit e370a723632 ("af_unix: improve STREAM behavior with fragmented memory") added a bug on large send() because the skb_copy_datagram_from_iovec() call always start from the beginning of iovec. We must instead use the @sent variable to properly skip the already processed part. Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/unix/af_unix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 5163b09a4..5b9ebf3ae 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1897,7 +1897,8 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
skb_put(skb, size - data_len);
skb->data_len = data_len;
skb->len = size;
- err = skb_copy_datagram_from_iovec(skb, 0, msg->msg_iov, 0, size);
+ err = skb_copy_datagram_from_iovec(skb, 0, msg->msg_iov,
+ sent, size);
if (err) {
kfree_skb(skb);
goto out_err;