Re: Bug report: leak in isdn/module related part

Andreas Degert (ad@papyrus.hamburg.com)
03 Apr 1997 00:16:29 +0200


[...]

I could reproduce the leakage with your script (sent to me by private
email). When you delete the routes for a device, the struct fib_info
is taken out of the list when the ref count goes to zero but the
memory isn't returned. The patch is against 2.0.29.

--------------------------------------------------------------------
diff -u --recursive linux-2.0.orig/net/ipv4/route.c linux-2.0/net/ipv4/route.c
--- linux-2.0.orig/net/ipv4/route.c Fri Jul 5 10:58:35 1996
+++ linux-2.0/net/ipv4/route.c Wed Apr 2 23:43:15 1997
@@ -203,6 +203,7 @@
fi->fib_prev->fib_next = fi->fib_next;
if (fi == fib_info_list)
fib_info_list = fi->fib_next;
+ kfree_s(fi,sizeof(struct fib_info));
}
kfree_s(f, sizeof(struct fib_node));
}
--------------------------------------------------------------------

PS: I found the leak with my leak-finder kernel patches, posted to
linux-kernel some days ago (couldn't resist advertising :-))

ciao

Andreas