Skip to content

Commit

Permalink
[IPV6] UDP: Possible dst leak in udpv6_sendmsg.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YOSHIFUJI Hideaki committed Jun 4, 2008
1 parent e511710 commit a3c9608
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,12 +848,14 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
} 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;
Expand Down

0 comments on commit a3c9608

Please sign in to comment.