From patchwork Fri Apr 29 14:40:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Maloy X-Patchwork-Id: 616850 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qxGbQ2ZBRz9t4b for ; Sat, 30 Apr 2016 00:41:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=yahoo.com header.i=@yahoo.com header.b=sSeD0hwY; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753581AbcD2OlE (ORCPT ); Fri, 29 Apr 2016 10:41:04 -0400 Received: from smtp105.biz.mail.bf1.yahoo.com ([98.139.221.43]:22758 "EHLO smtp105.biz.mail.bf1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753023AbcD2OlC (ORCPT ); Fri, 29 Apr 2016 10:41:02 -0400 Received: (qmail 26415 invoked from network); 29 Apr 2016 14:41:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1461940860; bh=SVvQoBg9eDqcP3p6KXlBacVyeRwAXh0eLZBsQV3BVXM=; h=From:To:Cc:Subject:Date:Message-Id; b=sSeD0hwYPNy/Ra4R4JSnn50Z84RCG3IibzrrF/H+7vbvwcm/h2sd2vmcluFsRek/xa6wJpv0gq23MeyHaRrCvYfHEyeP9HmnxOku7qgF7TfKCDWRDripRv1NhGv9MPQBPswzaPxoRhrReHUrM+UFQdtdT7C69F4rIxKD4HEWC84= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: syXBAF4VM1n260KEbb.tFGWimG79megzBOIfYrZ6QWxiRFu u6KtXILEka2LiNvKdH9N1lO2BfCuBxpbPtVqd1ut5GBipkjSEK9.C9Az2vBT s9EFLtQgEViuTcPAqy35Z8WuvGWl1tNlca68j5fj7bziWqoKb8MlrKi_PGzp B3T6lPYHJZpe0FUHM0yknVkyS75RjcxPFnA.mSEz3OgKOj0mTmpidykBNMXa J.mo3va7Wybu56ss2HHHkGtLTWXQ3eEKXCJcQKfL_POu8mMvUC6msGwVMUQQ _FXNt3JxZwMdT_EYog6bh..nT2IEs7IvkNyc08cfVQiSXxauweMae71ofDRc nKd6Uo1ONRPbEoDWYNYuftmVrrws_R1R7vqPD9UQgfANf76mvpoV_vREtIYn 7e9b9SfLbCAUhhzcMOW._XPxFEeshBTosBHAruSiqipChDK4kyJa4_aX3qqM W0KjP7oiYzrnYEkUwik1aXQPFzsHmFRFlcw0nyCUXsN4.2FEIxVPFztji7rH dSPtQSKbG1FF2BDxcnQdXVhuwQqISOFJo X-Yahoo-SMTP: gPXIZm2swBAFQJ_Vx0CebjUfUdhJ From: Jon Maloy To: davem@davemloft.net Cc: netdev@vger.kernel.org, Paul Gortmaker , parthasarathy.bhuvaragan@ericsson.com, richard.alpe@ericsson.com, ying.xue@windriver.com, maloy@donjonn.com, tipc-discussion@lists.sourceforge.net, Hamish Martin , Jon Maloy Subject: [PATCH net v2 1/1] tipc: only process unicast on intended node Date: Fri, 29 Apr 2016 10:40:24 -0400 Message-Id: <1461940824-20121-1-git-send-email-jon.maloy@ericsson.com> X-Mailer: git-send-email 1.9.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Hamish Martin We have observed complete lock up of broadcast-link transmission due to unacknowledged packets never being removed from the 'transmq' queue. This is traced to nodes having their ack field set beyond the sequence number of packets that have actually been transmitted to them. Consider an example where node 1 has sent 10 packets to node 2 on a link and node 3 has sent 20 packets to node 2 on another link. We see examples of an ack from node 2 destined for node 3 being treated as an ack from node 2 at node 1. This leads to the ack on the node 1 to node 2 link being increased to 20 even though we have only sent 10 packets. When node 1 does get around to sending further packets, none of the packets with sequence numbers less than 21 are actually removed from the transmq. To resolve this we reinstate some code lost in commit d999297c3dbb ("tipc: reduce locking scope during packet reception") which ensures that only messages destined for the receiving node are processed by that node. This prevents the sequence numbers from getting out of sync and resolves the packet leakage, thereby resolving the broadcast-link transmission lock-ups we observed. While we are aware that this change only patches over a root problem that we still haven't identified, this is a sanity test that it is always legitimate to do. It will remain in the code even after we identify and fix the real problem. Reviewed-by: Chris Packham Reviewed-by: John Thompson Signed-off-by: Hamish Martin Signed-off-by: Jon Maloy --- net/tipc/node.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/tipc/node.c b/net/tipc/node.c index ace178f..9aaa1bc 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -1444,6 +1444,7 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b) int bearer_id = b->identity; struct tipc_link_entry *le; u16 bc_ack = msg_bcast_ack(hdr); + u32 self = tipc_own_addr(net); int rc = 0; __skb_queue_head_init(&xmitq); @@ -1460,6 +1461,10 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b) return tipc_node_bc_rcv(net, skb, bearer_id); } + /* Discard unicast link messages destined for another node */ + if (unlikely(!msg_short(hdr) && (msg_destnode(hdr) != self))) + goto discard; + /* Locate neighboring node that sent packet */ n = tipc_node_find(net, msg_prevnode(hdr)); if (unlikely(!n))