From: David Miller Subject: Re: [net 1/1] tipc: fix infinite loop when dumping link monitor summary Date: Wed, 18 Apr 2018 13:49:05 -0400 (EDT) Message-ID: <20180418.134905.1248184259841196893.davem@davemloft.net> References: <1523995107-7325-1-git-send-email-jon.maloy@ericsson.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, mohan.krishna.ghanta.krishnamurthy@ericsson.com, tung.q.nguyen@dektech.com.au, hoang.h.le@dektech.com.au, canh.d.luu@dektech.com.au, ying.xue@windriver.com, tipc-discussion@lists.sourceforge.net To: jon.maloy@ericsson.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:46100 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751232AbeDRRtH (ORCPT ); Wed, 18 Apr 2018 13:49:07 -0400 In-Reply-To: <1523995107-7325-1-git-send-email-jon.maloy@ericsson.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Jon Maloy Date: Tue, 17 Apr 2018 21:58:27 +0200 > From: Tung Nguyen > > When configuring the number of used bearers to MAX_BEARER and issuing > command "tipc link monitor summary", the command enters infinite loop > in user space. > > This issue happens because function tipc_nl_node_dump_monitor() returns > the wrong 'prev_bearer' value when all potential monitors have been > scanned. > > The correct behavior is to always try to scan all monitors until either > the netlink message is full, in which case we return the bearer identity > of the affected monitor, or we continue through the whole bearer array > until we can return MAX_BEARERS. This solution also caters for the case > where there may be gaps in the bearer array. > > Signed-off-by: Tung Nguyen > Signed-off-by: Jon Maloy Applied.