Possible dst leak in udpv6_sendmsg.
Subsystems (3)
PATCH 1/1 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.
--- net/ipv6/udp.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
net/ipv6/udp.c +1 -0
@@ -813,6 +813,7 @@ back_from_confirm:/* The socket is already corked while preparing it. */ /* ... which is an evident application bug. --ANK */ release_sock (sk); +dst_release (dst);LIMIT_NETDEBUG (KERN_DEBUG "udp cork app bug 2\n" ); err = -EINVAL ;
Signature · 1 line
1.5.3.rc5
In article <[email protected]> (at Tue, 3 Jun 2008 15:08:42 +0400), "Denis V. Lunev" <[email protected]> says:
Quoted 2 lines
ip6_sk_dst_lookupreturns held dst entry. It should be released on all paths beyond this point. Add missed release whenup->pendingis set.
Which kernel are you refering?
And, would you please take a look at ipv4 side as well?
--yoshfuji
Quoted 6 lines · YOSHIFUJI Hideaki / 吉藤英明
In article <[email protected]> (at Tue, 3 Jun 2008 15:08:42 +0400), "Denis V. Lunev" <[email protected]> says:
Quoted 2 lines
ip6_sk_dst_lookupreturns held dst entry. It should be released on all paths beyond this point. Add missed release whenup->pendingis set.Which kernel are you refering?
The patch is made against current net-2.6 tree, though all kernels are affected, starting at least RHEL5
Quoted 1 line
And, would you please take a look at ipv4 side as well?
ipv4 is ok, the code looks the same but there is an ip_rt_put at the
out: label.
In article <[email protected]> (at Tue, 03 Jun 2008 15:50:45 +0400), "Denis V. Lunev" <[email protected]> says:
Quoted 6 lines · YOSHIFUJI Hideaki / 吉藤英明
Quoted 5 lines
In article <[email protected]> (at Tue, 3 Jun 2008 15:08:42 +0400), "Denis V. Lunev" <[email protected]> says:
Quoted 2 lines
ip6_sk_dst_lookupreturns held dst entry. It should be released on all paths beyond this point. Add missed release whenup->pendingis set.
Quoted 9 lines
Quoted 1 line
Which kernel are you refering?
The patch is made against current net-2.6 tree, though all kernels are affected, starting at least RHEL5
Quoted 1 line
And, would you please take a look at ipv4 side as well?
ipv4 is ok, the code looks the same but there is an
ip_rt_putat the
out: label.
Okay, I think we have one more leakage here (in do_confirm path). How about this?
net/ipv6/udp.c +2 -0
@@ -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;
--yoshfuji
Denis V. Lunev
Acked-byQuoted 1 line · YOSHIFUJI Hideaki / 吉藤英明
udp.c
In article <[email protected]> (at Tue, 03 Jun 2008 20:34:08 +0400), "Denis V. Lunev" <[email protected]> says:
Quoted 1 line
Acked-by Denis V. Lunev <[email protected]>
Okay, I'm queueing this for net-2.6. Thanks.
--yoshfuji