ChangeSet 1.2009.16.6, 2005/03/14 21:28:10-08:00, [EMAIL PROTECTED]
[NETLINK]: Fix multicast bind/autobind race
netlink_autobind has always set nlk_sk(sk)->groups to zero. This is
unnecessary because sk_alloc already zeroes the entire structure.
Since a socket can only be bound once netlink_autobind doesn't need
to zero groups at all.
This had been safe until I added mc_list. Now it is possible for
netlink_bind to race against netlink_autobind running on the same
socket on another CPU. The result would be a socket that's on
mc_list with groups set to zero. This socket will be left on the
list even after it is destroyed.
The fix is to remove the zeroing in netlink_autobind.
Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
af_netlink.c | 1 -
1 files changed, 1 deletion(-)
diff -Nru a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
--- a/net/netlink/af_netlink.c 2005-03-15 00:08:24 -08:00
+++ b/net/netlink/af_netlink.c 2005-03-15 00:08:24 -08:00
@@ -430,7 +430,6 @@
err = netlink_insert(sk, pid);
if (err == -EADDRINUSE)
goto retry;
- nlk_sk(sk)->groups = 0;
return 0;
}
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html