Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932975AbbLHGNq (ORCPT ); Tue, 8 Dec 2015 01:13:46 -0500 Received: from helcar.hengli.com.au ([209.40.204.226]:41795 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751586AbbLHGNn (ORCPT ); Tue, 8 Dec 2015 01:13:43 -0500 Date: Tue, 8 Dec 2015 14:13:19 +0800 From: Herbert Xu To: Stefan Priebe - Profihost AG Cc: Hannes Frederic Sowa , Florian Weimer , Thomas Gleixner , netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, jannik Winkel , Marco Schinkel , "David S. Miller" , stable@vger.kernel.org Subject: netlink: Add missing goto statement to netlink_insert Message-ID: <20151208061319.GA16209@gondor.apana.org.au> References: <564E2852.8000200@profihost.ag> <56530A42.6030609@profihost.ag> <1448283451.4019628.447573353.3659E447@webmail.messagingengine.com> <565EBDC1.1090808@profihost.ag> <8737vlt6xb.fsf@stressinduktion.org> <5661DAC4.8040909@profihost.ag> <20151205010819.GA21889@gondor.apana.org.au> <5664A102.2030602@profihost.ag> <20151207012042.GA7420@gondor.apana.org.au> <56652E11.4010604@profihost.ag> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56652E11.4010604@profihost.ag> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1499 Lines: 41 On Mon, Dec 07, 2015 at 07:58:25AM +0100, Stefan Priebe - Profihost AG wrote: > > Thanks, good. Can you help me to get this fix upstream into the stable > lines? Sure. Greg, please apply this patch to fix up the backport for 4.1. ---8<--- The backport of 1f770c0a09da855a2b51af6d19de97fb955eca85 ("netlink: Fix autobind race condition that leads to zero port ID") missed a goto statement, which causes netlink to break subtly. This was discovered by Stefan Priebe . Fixes: 4e2776241766 ("netlink: Fix autobind race condition that...") Reported-by: Stefan Priebe Reported-by: Philipp Hahn Signed-off-by: Herbert Xu diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index d139c43..0d6038c 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1118,6 +1118,7 @@ static int netlink_insert(struct sock *sk, u32 portid) if (err == -EEXIST) err = -EADDRINUSE; sock_put(sk); + goto err; } /* We need to ensure that the socket is hashed and visible. */ -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/