From: Chris Wright Date: Mon, 27 Jun 2005 04:58:56 +0000 (-0700) Subject: Update netlink patch with new version from DaveM. X-Git-Tag: v2.6.12.2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42c9473bba03610760050c85976a78f8db4bd8ef;p=thirdparty%2Fkernel%2Fstable-queue.git Update netlink patch with new version from DaveM. --- diff --git a/queue/netlink-socket-hang.patch b/queue/netlink-socket-hang.patch index 157dcbe3dd2..a0e7434738e 100644 --- a/queue/netlink-socket-hang.patch +++ b/queue/netlink-socket-hang.patch @@ -1,6 +1,7 @@ -From stable-bounces@linux.kernel.org Sun Jun 26 00:39:03 2005 -Date: Sun, 26 Jun 2005 00:38:51 -0700 (PDT) -To: stable@kernel.org +From davem@davemloft.net Sun Jun 26 15:35:17 2005 +Date: Sun, 26 Jun 2005 15:35:08 -0700 (PDT) +To: chrisw@osdl.org +Cc: stable@kernel.org From: "David S. Miller" Subject: [PATCH][NETLINK]: Fix two socket hashing bugs. @@ -22,6 +23,10 @@ Subject: [PATCH][NETLINK]: Fix two socket hashing bugs. as they should and thus try to operate on a socket with a zero pid, which is very bad. + However, it should not propagate -EBUSY. If two threads race + to autobind the socket, that is fine. This is consistent with the + autobind behavior in other protocols. + So bug #1 above, combined with this one, resulted in hangs on netlink_sendmsg() calls to the rtnetlink socket. We'd try to do the user sendmsg() with the socket's pid set to zero, @@ -31,16 +36,17 @@ Subject: [PATCH][NETLINK]: Fix two socket hashing bugs. try to wake up the receive queue, we dive back into rtnetlink_rcv() which tries to recursively take the rtnetlink semaphore. -Thanks to Jakub Jelink for providing backtraces, and Herbert Xu for -debugging patches to help track this down. +Thanks to Jakub Jelink for providing backtraces. Also, thanks to +Herbert Xu for supplying debugging patches to help track this down, +and also finding a mistake in an earlier version of this fix. Signed-off-by: David S. Miller Signed-off-by: Chris Wright +--- -diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c ---- a/net/netlink/af_netlink.c -+++ b/net/netlink/af_netlink.c -@@ -315,8 +315,8 @@ err: +--- 1/net/netlink/af_netlink.c.~1~ 2005-06-26 15:30:20.000000000 -0700 ++++ 2/net/netlink/af_netlink.c 2005-06-26 15:30:46.000000000 -0700 +@@ -315,8 +315,8 @@ static void netlink_remove(struct sock *sk) { netlink_table_grab(); @@ -51,18 +57,18 @@ diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c if (nlk_sk(sk)->groups) __sk_del_bind_node(sk); netlink_table_ungrab(); -@@ -429,7 +429,7 @@ retry: +@@ -429,7 +429,12 @@ err = netlink_insert(sk, pid); if (err == -EADDRINUSE) goto retry; - return 0; ++ ++ /* If 2 threads race to autobind, that is fine. */ ++ if (err == -EBUSY) ++ err = 0; ++ + return err; } static inline int netlink_capable(struct socket *sock, unsigned int flag) -_______________________________________________ -stable mailing list -stable@linux.kernel.org -http://linux.kernel.org/mailman/listinfo/stable -