diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2015-10-15 14:25:03 +0200 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2015-12-06 00:49:13 +0100 |
commit | c507639ba963bb47e3f515670a7cace76af76ab6 (patch) | |
tree | 6b354bd693bc19715e7e1b554bfee09083d10263 /include | |
parent | 0b1b85deb213efaee4ea289cc881bb50116d1a6e (diff) |
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.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
[bwh: Backported to 3.2: adjust context in include/linux/skbuff.h]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from commit 127500d724f8c43f452610c9080444eedb5eaa6c)
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/skbuff.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ae77862160ba..c282a2cba635 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1765,7 +1765,8 @@ 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); + struct iovec *iov, + int len); extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset, const struct iovec *from, |