public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix dst_entry leak in icmp_push_reply()
@ 2005-08-17 20:21 Ollie Wild
  2005-08-17 23:56 ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Ollie Wild @ 2005-08-17 20:21 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

If the ip_append_data() call in icmp_push_reply() fails, 
ip_flush_pending_frames() needs to be called.  Otherwise, ip_rt_put() is 
never called on inet_sk(icmp_socket->sk)->cork.rt, which prevents the 
route (and net_device) from ever being freed.

I've attached a patch which fixes the problem.

Ollie Wild

[-- Attachment #2: icmp_push_reply.patch --]
[-- Type: text/x-patch, Size: 334 bytes --]

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -368,6 +368,8 @@ static void icmp_push_reply(struct icmp_
 		icmph->checksum = csum_fold(csum);
 		skb->ip_summed = CHECKSUM_NONE;
 		ip_push_pending_frames(icmp_socket->sk);
+	} else {
+		ip_flush_pending_frames(icmp_socket->sk);
 	}
 }
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-08-18 21:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-17 20:21 [PATCH] fix dst_entry leak in icmp_push_reply() Ollie Wild
2005-08-17 23:56 ` Patrick McHardy
2005-08-18  6:41   ` Ollie Wild
2005-08-18 18:42     ` Patrick McHardy
2005-08-18 18:45     ` Ollie Wild
2005-08-18 18:59       ` Patrick McHardy
2005-08-18 19:05         ` Ollie Wild
2005-08-18 21:32           ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox