* Sock leak in net/ipv4/af_inet.c - 2.4.26
@ 2004-05-11 16:24 Dickey, Dan
2004-05-11 16:43 ` Marc-Christian Petersen
0 siblings, 1 reply; 5+ messages in thread
From: Dickey, Dan @ 2004-05-11 16:24 UTC (permalink / raw)
To: kuznet, davem; +Cc: linux-kernel
Alexey & Dave,
I hope these are good addresses for you - it has been a few years since
I've tried to contact you.
I've found a leak in af_inet.c, routine inet_create().
It allocates from the sock slab using sk_alloc(), but
sk_free() is never called on these sock structs.
I'm not that familiar with the af_inet code, but I'll
continue taking a look at it to try and determine where
the missing sk_free() is supposed to be.
If either of you or anyone else has an idea, please
let me know. We have several 2GB mem systems that need
to be rebooted every few days because of this problem.
Oh - by the way, it looks like this is happening in
net/ipv4/tcp_minisocks.c as well. Routine tcp_create_openreq_child().
There is no corresponding sk_free() call for the sk_alloc() in here.
In order to track these down, I've added some simple debug code
around the sk_alloc/sk_free calls to track allocations. I know
where the leaky sock structs are being allocated from, but not
where they should be freed.
The bugzilla.kernel.org bug # is 2676.
-Dan
------
Dan A. Dickey
dan.dickey@savvis.net
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sock leak in net/ipv4/af_inet.c - 2.4.26
2004-05-11 16:24 Sock leak in net/ipv4/af_inet.c - 2.4.26 Dickey, Dan
@ 2004-05-11 16:43 ` Marc-Christian Petersen
2004-05-11 17:25 ` Dan A. Dickey
0 siblings, 1 reply; 5+ messages in thread
From: Marc-Christian Petersen @ 2004-05-11 16:43 UTC (permalink / raw)
To: linux-kernel; +Cc: Dickey, Dan, kuznet, davem
On Tuesday 11 May 2004 18:24, Dickey, Dan wrote:
Hi Dan,
> I've found a leak in af_inet.c, routine inet_create().
> It allocates from the sock slab using sk_alloc(), but
> sk_free() is never called on these sock structs.
> I'm not that familiar with the af_inet code, but I'll
> continue taking a look at it to try and determine where
> the missing sk_free() is supposed to be.
> If either of you or anyone else has an idea, please
> let me know. We have several 2GB mem systems that need
> to be rebooted every few days because of this problem.
> Oh - by the way, it looks like this is happening in
> net/ipv4/tcp_minisocks.c as well. Routine tcp_create_openreq_child().
> There is no corresponding sk_free() call for the sk_alloc() in here.
> In order to track these down, I've added some simple debug code
> around the sk_alloc/sk_free calls to track allocations. I know
> where the leaky sock structs are being allocated from, but not
> where they should be freed.
am I silly or do I see lots of sk_free(sk); in there?
ciao, Marc
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sock leak in net/ipv4/af_inet.c - 2.4.26
2004-05-11 16:43 ` Marc-Christian Petersen
@ 2004-05-11 17:25 ` Dan A. Dickey
2004-05-11 18:59 ` David S. Miller
0 siblings, 1 reply; 5+ messages in thread
From: Dan A. Dickey @ 2004-05-11 17:25 UTC (permalink / raw)
To: Marc-Christian Petersen; +Cc: linux-kernel, kuznet, davem
On Tuesday 11 May 2004 11:43, Marc-Christian Petersen wrote:
> On Tuesday 11 May 2004 18:24, Dickey, Dan wrote:
>
> Hi Dan,
>
> > I've found a leak in af_inet.c, routine inet_create().
> > It allocates from the sock slab using sk_alloc(), but
> > sk_free() is never called on these sock structs.
> > I'm not that familiar with the af_inet code, but I'll
> > continue taking a look at it to try and determine where
> > the missing sk_free() is supposed to be.
> > If either of you or anyone else has an idea, please
> > let me know. We have several 2GB mem systems that need
> > to be rebooted every few days because of this problem.
> > Oh - by the way, it looks like this is happening in
> > net/ipv4/tcp_minisocks.c as well. Routine tcp_create_openreq_child().
> > There is no corresponding sk_free() call for the sk_alloc() in here.
> > In order to track these down, I've added some simple debug code
> > around the sk_alloc/sk_free calls to track allocations. I know
> > where the leaky sock structs are being allocated from, but not
> > where they should be freed.
>
> am I silly or do I see lots of sk_free(sk); in there?
>
> ciao, Marc
Marc,
there are zero sk_free() calls in tcp_minisocks.c and
three in af_inet.c. Go take another look.
Remember - 2.4.26 sources.
-Dan
--
Dan A. Dickey
dan.dickey@savvis.net
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sock leak in net/ipv4/af_inet.c - 2.4.26
2004-05-11 17:25 ` Dan A. Dickey
@ 2004-05-11 18:59 ` David S. Miller
2004-05-11 19:55 ` Dan A. Dickey
0 siblings, 1 reply; 5+ messages in thread
From: David S. Miller @ 2004-05-11 18:59 UTC (permalink / raw)
To: dan.dickey; +Cc: m.c.p, linux-kernel, kuznet
The sk_free() should occur when the final sock_put() call brings the count
down to zero, then the socket destroy function is called and the eventual
sk_free() occurs there.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sock leak in net/ipv4/af_inet.c - 2.4.26
2004-05-11 18:59 ` David S. Miller
@ 2004-05-11 19:55 ` Dan A. Dickey
0 siblings, 0 replies; 5+ messages in thread
From: Dan A. Dickey @ 2004-05-11 19:55 UTC (permalink / raw)
To: David S. Miller; +Cc: m.c.p, linux-kernel, kuznet
On Tuesday 11 May 2004 13:59, David S. Miller wrote:
> The sk_free() should occur when the final sock_put() call brings the count
> down to zero, then the socket destroy function is called and the eventual
> sk_free() occurs there.
Yes, I'm figuring this out.
I think my earlier report of this problem was a bit premature.
I'm refining my debug code and will let you know what I find.
-Dan
--
Dan A. Dickey
dan.dickey@savvis.net
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-05-11 19:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-11 16:24 Sock leak in net/ipv4/af_inet.c - 2.4.26 Dickey, Dan
2004-05-11 16:43 ` Marc-Christian Petersen
2004-05-11 17:25 ` Dan A. Dickey
2004-05-11 18:59 ` David S. Miller
2004-05-11 19:55 ` Dan A. Dickey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox