[IPV6] UDP: Possible dst leak in udpv6_sendmsg.
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Tue, 3 Jun 2008 16:30:25 +0000 (01:30 +0900)
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Wed, 4 Jun 2008 19:02:31 +0000 (04:02 +0900)
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>
net/ipv6/udp.c

index 1fd784f..47123bf 100644 (file)
@@ -848,12 +848,14 @@ do_append_data:
                } else {
                        dst_release(dst);
                }
+               dst = NULL;
        }
 
        if (err > 0)
                err = np->recverr ? net_xmit_errno(err) : 0;
        release_sock(sk);
 out:
+       dst_release(dst);
        fl6_sock_release(flowlabel);
        if (!err)
                return len;