Skip to contentSkip to conversation

2.4: [NETLINK] Fix bogus mc_list deletion

PATCH Herbert Xu 1 participant 1 message Mar 29, 2005 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Herbert Xu

author
#1 lore raw
In reply to a message not in the archive
Quoted 5 lines · Tim Burress

So not only is the socket dead, it's not even a Netlink socket. Apparently a socket originally allocated to Netlink was not unlinked from the mc_list after it was freed, but offhand I can't see how that could happen.

Thanks for tracking this issue down.

Looks like I made a nasty typo in the 2.4 backport. When entries are unlinked from mc_list, we link the list up with the regular hash bucket list by using next instead of bind_next!

Marcelo, you'll want this to be in the next rc.

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

===== net/netlink/af_netlink.c 1.21 vs edited =====

net/netlink/af_netlink.c +2 -2
@@ -340,9 +340,9 @@
 	}
 	if (!nlk_sk(sk)->groups)
 		goto out;
-	for (skp = &table->mc_list; *skp; skp = &((*skp)->next)) {
+	for (skp = &table->mc_list; *skp; skp = &((*skp)->bind_next)) {
 		if (*skp == sk) {
-			*skp = sk->next;
+			*skp = sk->bind_next;
 			break;
 		}
 	}