diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-09-20 23:41:36 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-09-26 21:54:43 +0400 |
commit | bbaded590e3293abbbca4d58a8fb7ad8447b2640 (patch) | |
tree | 8798da13f4ba52caf5ddc46ed9fd23def5a40c83 /net/core | |
parent | 6d742fb6e2b8913457e1282e1be77d6f4e45af00 (diff) | |
download | linux-bbaded590e3293abbbca4d58a8fb7ad8447b2640.tar.xz |
Fix datagram recvmsg NULL iov handling regression.
commit ef8aef55ce61fd0e2af798695f7386ac756ae1e7 in mainline
Subject: [PATCH] [NET]: Do not dereference iov if length is zero
When msg_iovlen is zero we shouldn't try to dereference
msg_iov. Right now the only thing that tries to do so
is skb_copy_and_csum_datagram_iovec. Since the total
length should also be zero if msg_iovlen is zero, it's
sufficient to check the total length there and simply
return if it's zero.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/datagram.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c index cb056f476126..029b93e246b4 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -450,6 +450,9 @@ int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, __wsum csum; int chunk = skb->len - hlen; + if (!chunk) + return 0; + /* Skip filled elements. * Pretty silly, look at memcpy_toiovec, though 8) */ |