From patchwork Wed Jan 23 17:11:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 2711 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=5.9.180.86; helo=chaos.universe-factory.net; envelope-from=mschiffer@universe-factory.net; receiver=b.a.t.m.a.n@lists.open-mesh.org X-Greylist: delayed 452 seconds by postgrey-1.34 at open-mesh.org; Wed, 23 Jan 2013 18:19:33 CET Received: from chaos.universe-factory.net (chaos.universe-factory.net [5.9.180.86]) by open-mesh.org (Postfix) with ESMTP id 01A12601B84 for ; Wed, 23 Jan 2013 18:19:32 +0100 (CET) Received: from avalon.wlan90.uni-luebeck.de (client002.wlan90.uni-luebeck.de [141.83.90.66]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by chaos.universe-factory.net (Postfix) with ESMTPSA id BDA2E180FF1 for ; Wed, 23 Jan 2013 18:11:59 +0100 (CET) From: Matthias Schiffer To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 23 Jan 2013 18:11:53 +0100 Message-Id: X-Mailer: git-send-email 1.8.1.1 Subject: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: fix skb leak in batadv_dat_snoop_incoming_arp_reply() X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 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: Wed, 23 Jan 2013 17:19:33 -0000 The callers of batadv_dat_snoop_incoming_arp_reply() assume the skb has been freed when it returns true; fix this by calling kfree_skb before returning as it is done in batadv_dat_snoop_incoming_arp_request(). Signed-off-by: Matthias Schiffer Acked-by: Antonio Quartulli Acked-by: Antonio Quartulli --- distributed-arp-table.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/distributed-arp-table.c b/distributed-arp-table.c index 7485a78..9f4cff3 100644 --- a/distributed-arp-table.c +++ b/distributed-arp-table.c @@ -1012,6 +1012,8 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv, */ ret = !batadv_is_my_client(bat_priv, hw_dst); out: + if (ret) + kfree_skb(skb); /* if ret == false -> packet has to be delivered to the interface */ return ret; }