From patchwork Sun Sep 12 21:00:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 378 Return-Path: Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23]) by open-mesh.net (Postfix) with SMTP id 421E515430E for ; Sun, 12 Sep 2010 23:00:39 +0200 (CEST) Received: (qmail invoked by alias); 12 Sep 2010 21:00:38 -0000 Received: from i59F6B2E6.versanet.de (EHLO sven-desktop.lazhur.ath.cx) [89.246.178.230] by mail.gmx.net (mp017) with SMTP; 12 Sep 2010 23:00:38 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX18akupLTa4afoyAOAr4vXEfcJ8BLFPN/RG19lHPov O80+CdEfkQjxv0 From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 12 Sep 2010 23:00:42 +0200 Message-Id: <1284325242-29661-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <201009122244.00861.sven.eckelmann@gmx.de> References: <201009122244.00861.sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Unlock on failure during fragmentation rx X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 21:00:39 -0000 When we detect a failure in create_frag_buffer we must drop the packet and unlock the orig_has which was locked before. 69d187ffb8e22024a87d8457e5dcb10e297108e9 forgot that and created a potential deadlock of the complete system. Signed-off-by: Sven Eckelmann --- routing.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/routing.c b/routing.c index 23a12cd..a07e0e0 100644 --- a/routing.c +++ b/routing.c @@ -1233,9 +1233,11 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if) orig_node->last_frag_packet = jiffies; - if (list_empty(&orig_node->frag_list)) { - if (create_frag_buffer(&orig_node->frag_list)) - return NET_RX_DROP; + if (list_empty(&orig_node->frag_list) && + create_frag_buffer(&orig_node->frag_list)) { + spin_unlock_irqrestore(&bat_priv->orig_hash_lock, + flags); + return NET_RX_DROP; } tmp_frag_entry =