Author: qboosh                       Date: Mon Feb 28 13:57:58 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix netlink sockets leak

---- Files affected:
SOURCES:
   linux-2.4-netlink-leak.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/linux-2.4-netlink-leak.patch
diff -u /dev/null SOURCES/linux-2.4-netlink-leak.patch:1.1
--- /dev/null   Mon Feb 28 14:57:58 2005
+++ SOURCES/linux-2.4-netlink-leak.patch        Mon Feb 28 14:57:53 2005
@@ -0,0 +1,40 @@
+# This is a BitKeeper generated diff -Nru style patch.
+#
+# ChangeSet
+#   2005/02/16 11:22:03-08:00 [EMAIL PROTECTED] 
+#   [NETLINK]: Unhash sockets correctly.
+#   
+#   netlink_remove() only unhashes sockets contained in the 
+#   first hash bucket.  This leads to leaking sockets and,
+#   over time, to bind conflicts which confuse iproute.
+#   
+#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
+#   Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
+# 
+# net/netlink/af_netlink.c
+#   2005/02/16 11:21:57-08:00 [EMAIL PROTECTED] +2 -1
+#   [NETLINK]: Unhash sockets correctly.
+#   
+#   netlink_remove() only unhashes sockets contained in the 
+#   first hash bucket.  This leads to leaking sockets and,
+#   over time, to bind conflicts which confuse iproute.
+#   
+#   Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
+#   Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
+# 
+diff -Nru a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
+--- a/net/netlink/af_netlink.c 2005-02-28 05:21:50 -08:00
++++ b/net/netlink/af_netlink.c 2005-02-28 05:21:50 -08:00
+@@ -327,10 +327,11 @@
+       struct sock **skp;
+       struct netlink_table *table = &nl_table[sk->protocol];
+       struct nl_pid_hash *hash = &table->hash;
++      u32 pid = nlk_sk(sk)->pid;
+ 
+       netlink_table_grab();
+       hash->entries--;
+-      for (skp = hash->table; *skp; skp = &((*skp)->next)) {
++      for (skp = nl_pid_hashfn(hash, pid); *skp; skp = &((*skp)->next)) {
+               if (*skp == sk) {
+                       *skp = sk->next;
+                       __sock_put(sk);
================================================================

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to