Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933913AbbFSVTK (ORCPT ); Fri, 19 Jun 2015 17:19:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51515 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753304AbbFSUjH (ORCPT ); Fri, 19 Jun 2015 16:39:07 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Herbert Xu , "David S. Miller" Subject: [PATCH 4.0 007/105] netlink: Reset portid after netlink_insert failure Date: Fri, 19 Jun 2015 13:34:57 -0700 Message-Id: <20150619203558.427389882@linuxfoundation.org> X-Mailer: git-send-email 2.4.4 In-Reply-To: <20150619203558.187802739@linuxfoundation.org> References: <20150619203558.187802739@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1247 Lines: 39 4.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Herbert Xu [ Upstream commit c0bb07df7d981e4091432754e30c9c720e2c0c78 ] The commit c5adde9468b0714a051eac7f9666f23eb10b61f7 ("netlink: eliminate nl_sk_hash_lock") breaks the autobind retry mechanism because it doesn't reset portid after a failed netlink_insert. This means that should autobind fail the first time around, then the socket will be stuck in limbo as it can never be bound again since it already has a non-zero portid. Fixes: c5adde9468b0 ("netlink: eliminate nl_sk_hash_lock") Signed-off-by: Herbert Xu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/netlink/af_netlink.c | 1 + 1 file changed, 1 insertion(+) --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1069,6 +1069,7 @@ static int netlink_insert(struct sock *s err = 0; if (!__netlink_insert(table, sk)) { err = -EADDRINUSE; + nlk_sk(sk)->portid = 0; sock_put(sk); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/