Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757071AbbLHQVy (ORCPT ); Tue, 8 Dec 2015 11:21:54 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:37303 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757037AbbLHQVw (ORCPT ); Tue, 8 Dec 2015 11:21:52 -0500 Date: Tue, 08 Dec 2015 11:21:48 -0500 (EST) Message-Id: <20151208.112148.848925272627144797.davem@davemloft.net> To: herbert@gondor.apana.org.au Cc: s.priebe@profihost.ag, hannes@stressinduktion.org, fweimer@redhat.com, tglx@linutronix.de, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, j.winkel@profihost.ag, m.schinkel@profihost.ag, stable@vger.kernel.org Subject: Re: netlink: Add missing goto statement to netlink_insert From: David Miller In-Reply-To: <20151208061319.GA16209@gondor.apana.org.au> References: <20151207012042.GA7420@gondor.apana.org.au> <56652E11.4010604@profihost.ag> <20151208061319.GA16209@gondor.apana.org.au> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 08 Dec 2015 08:21:52 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1751 Lines: 49 From: Herbert Xu Date: Tue, 8 Dec 2015 14:13:19 +0800 > 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. Herbert, thanks so much for taking care of this. > ---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 Acked-by: David S. Miller > > 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/