From patchwork Tue Dec 8 06:13:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 7794571 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3130CBEEE1 for ; Tue, 8 Dec 2015 06:14:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 231AB20452 for ; Tue, 8 Dec 2015 06:14:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39002203F3 for ; Tue, 8 Dec 2015 06:14:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932890AbbLHGNo (ORCPT ); Tue, 8 Dec 2015 01:13:44 -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 Received: from gondolin.me.apana.org.au ([192.168.0.6]) by norbury.hengli.com.au with esmtp (Exim 4.80 #3 (Debian)) id 1a6BWg-0004Bd-Hj; Tue, 08 Dec 2015 17:13:26 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 4.80) (envelope-from ) id 1a6BWZ-0004Du-Hr; Tue, 08 Dec 2015 14:13:19 +0800 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-Disposition: inline In-Reply-To: <56652E11.4010604@profihost.ag> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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. */