aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-06-03 12:30:25 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-06-04 15:02:31 -0400
commita3c960899e042bc1c2b730a2115fa32da7802039 (patch)
treed12d8270414bc113b0ae5b7ffc0d23096b30e193
parente51171019bb0e1f9fb57c25bd2e38ce652eaea27 (diff)
[IPV6] UDP: Possible dst leak in udpv6_sendmsg.
ip6_sk_dst_lookup returns held dst entry. It should be released on all paths beyond this point. Add missed release when up->pending is set. Bug report and initial patch by Denis V. Lunev <den@openvz.org>. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Acked-by: Denis V. Lunev <den@openvz.org>
-rw-r--r--net/ipv6/udp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 1fd784f3e2ec..47123bf5eb0f 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -848,12 +848,14 @@ do_append_data:
848 } else { 848 } else {
849 dst_release(dst); 849 dst_release(dst);
850 } 850 }
851 dst = NULL;
851 } 852 }
852 853
853 if (err > 0) 854 if (err > 0)
854 err = np->recverr ? net_xmit_errno(err) : 0; 855 err = np->recverr ? net_xmit_errno(err) : 0;
855 release_sock(sk); 856 release_sock(sk);
856out: 857out:
858 dst_release(dst);
857 fl6_sock_release(flowlabel); 859 fl6_sock_release(flowlabel);
858 if (!err) 860 if (!err)
859 return len; 861 return len;