From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752538AbdLAUPB (ORCPT ); Fri, 1 Dec 2017 15:15:01 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:38424 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbdLAUO6 (ORCPT ); Fri, 1 Dec 2017 15:14:58 -0500 Date: Fri, 01 Dec 2017 15:14:56 -0500 (EST) Message-Id: <20171201.151456.1062866303008004895.davem@davemloft.net> To: tommi.t.rantala@nokia.com Cc: jon.maloy@ericsson.com, ying.xue@windriver.com, netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH net v2] tipc: call tipc_rcv() only if bearer is up in tipc_udp_recv() From: David Miller In-Reply-To: <20171129104842.30781-1-tommi.t.rantala@nokia.com> References: <20171129104842.30781-1-tommi.t.rantala@nokia.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / 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]); Fri, 01 Dec 2017 12:14:57 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tommi Rantala Date: Wed, 29 Nov 2017 12:48:42 +0200 > Remove the second tipc_rcv() call in tipc_udp_recv(). We have just > checked that the bearer is not up, and calling tipc_rcv() with a bearer > that is not up leads to a TIPC div-by-zero crash in > tipc_node_calculate_timer(). The crash is rare in practice, but can > happen like this: > > We're enabling a bearer, but it's not yet up and fully initialized. > At the same time we receive a discovery packet, and in tipc_udp_recv() > we end up calling tipc_rcv() with the not-yet-initialized bearer, > causing later the div-by-zero crash in tipc_node_calculate_timer(). > > Jon Maloy explains the impact of removing the second tipc_rcv() call: > "link setup in the worst case will be delayed until the next arriving > discovery messages, 1 sec later, and this is an acceptable delay." > > As the tipc_rcv() call is removed, just leave the function via the > rcu_out label, so that we will kfree_skb(). ... > Fixes: c9b64d492b1f ("tipc: add replicast peer discovery") > Signed-off-by: Tommi Rantala > Cc: Jon Maloy Applied and queued up for -stable, thanks.