diff options
author | Willy Tarreau <w@1wt.eu> | 2016-01-23 11:16:20 +0100 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2016-01-29 22:12:40 +0100 |
commit | d699b47f3c87c2fb30ed548ffacae85cebf2cafe (patch) | |
tree | 110bee0b6ab71eabc416c074b47a590cee813167 | |
parent | 6e5577bfd9e561ddb3167c4fcc815a8032b7952c (diff) | |
download | linux-stable-d699b47f3c87c2fb30ed548ffacae85cebf2cafe.tar.gz linux-stable-d699b47f3c87c2fb30ed548ffacae85cebf2cafe.tar.bz2 linux-stable-d699b47f3c87c2fb30ed548ffacae85cebf2cafe.zip |
Revert "net: add length argument to skb_copy_and_csum_datagram_iovec"
This reverts commit c507639ba963bb47e3f515670a7cace76af76ab6.
As reported by Michal Kubecek, this fix doesn't handle truncated
reads correctly. Next patch from Eric fixes it better.
Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r-- | include/linux/skbuff.h | 3 | ||||
-rw-r--r-- | net/core/datagram.c | 6 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 2 | ||||
-rw-r--r-- | net/ipv4/udp.c | 2 | ||||
-rw-r--r-- | net/ipv6/raw.c | 2 | ||||
-rw-r--r-- | net/ipv6/udp.c | 3 | ||||
-rw-r--r-- | net/rxrpc/ar-recvmsg.c | 3 |
7 files changed, 7 insertions, 14 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index c282a2cba635..ae77862160ba 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1765,8 +1765,7 @@ extern int skb_copy_datagram_iovec(const struct sk_buff *from, int size); extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen, - struct iovec *iov, - int len); + struct iovec *iov); extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset, const struct iovec *from, diff --git a/net/core/datagram.c b/net/core/datagram.c index 767c17aaddcb..253d068e8cba 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -693,7 +693,6 @@ EXPORT_SYMBOL(__skb_checksum_complete); * @skb: skbuff * @hlen: hardware length * @iov: io vector - * @len: amount of data to copy from skb to iov * * Caller _must_ check that skb will fit to this iovec. * @@ -703,14 +702,11 @@ EXPORT_SYMBOL(__skb_checksum_complete); * can be modified! */ int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, - int hlen, struct iovec *iov, int len) + int hlen, struct iovec *iov) { __wsum csum; int chunk = skb->len - hlen; - if (chunk > len) - chunk = len; - if (!chunk) return 0; diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d3dcfb9d736f..c821218b3834 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -4985,7 +4985,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, chunk); + tp->ucopy.iov); if (!err) { tp->ucopy.len -= chunk; diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 83b507d51968..3ae286b9c5ab 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -975,7 +975,7 @@ try_again: else { err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), - msg->msg_iov, copied); + msg->msg_iov); if (err == -EINVAL) goto csum_copy_err; diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index f016542cf849..d5b09c7ca402 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -476,7 +476,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, goto csum_copy_err; err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); } else { - err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov, copied); + err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov); if (err == -EINVAL) goto csum_copy_err; } diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 5c8bd19c9572..0b023f35103d 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -233,8 +233,7 @@ try_again: err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov, copied ); else { - err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), - msg->msg_iov, copied); + err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov); if (err == -EINVAL) goto csum_copy_err; } diff --git a/net/rxrpc/ar-recvmsg.c b/net/rxrpc/ar-recvmsg.c index 813e1c482e32..b6076b231b49 100644 --- a/net/rxrpc/ar-recvmsg.c +++ b/net/rxrpc/ar-recvmsg.c @@ -184,8 +184,7 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock, msg->msg_iov, copy); } else { ret = skb_copy_and_csum_datagram_iovec(skb, offset, - msg->msg_iov, - copy); + msg->msg_iov); if (ret == -EINVAL) goto csum_copy_error; } |