From: David Miller Subject: Re: [net 1/1] tipc: queue socket protocol error messages into socket receive buffer Date: Wed, 10 Oct 2018 22:57:03 -0700 (PDT) Message-ID: <20181010.225703.1696580424843839117.davem@davemloft.net> References: <1539186623-344-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, gordan.mihaljevic@dektech.com.au, 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 ([23.128.96.9]:49286 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbeJKNWp (ORCPT ); Thu, 11 Oct 2018 09:22:45 -0400 In-Reply-To: <1539186623-344-1-git-send-email-jon.maloy@ericsson.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Jon Maloy Date: Wed, 10 Oct 2018 17:50:23 +0200 > From: Parthasarathy Bhuvaragan > > In tipc_sk_filter_rcv(), when we detect protocol messages with error we > call tipc_sk_conn_proto_rcv() and let it reset the connection and notify > the socket by calling sk->sk_state_change(). > > However, tipc_sk_filter_rcv() may have been called from the function > tipc_backlog_rcv(), in which case the socket lock is held and the socket > already awake. This means that the sk_state_change() call is ignored and > the error notification lost. Now the receive queue will remain empty and > the socket sleeps forever. > > In this commit, we convert the protocol message into a connection abort > message and enqueue it into the socket's receive queue. By this addition > to the above state change we cover all conditions. > > Acked-by: Ying Xue > Signed-off-by: Parthasarathy Bhuvaragan > Signed-off-by: Jon Maloy Applied.