]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[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 1fd784f3e2ecf4dba2f48dd6ff134172b80df0d5..47123bf5eb0fb439a944cfbcfe99112b97e157d1 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;