[linux-next] LinuxNextTracking branch, master, updated. next-20130821

batman at open-mesh.org batman at open-mesh.org
Thu Aug 22 00:21:06 CEST 2013


The following commit has been merged in the master branch:
commit 50fa3b31f4700deb1a860fa1a04016b889765323
Author: Linus Lüssing <linus.luessing at web.de>
Date:   Sat Jul 27 03:24:44 2013 +0200

    batman-adv: check return type of unicast packet preparations
    
    batadv_unicast(_4addr)_prepare_skb  might reallocate the skb's data.
    And if it tries to do so then this can potentially fail.
    
    We shouldn't continue working on this skb in such a case.
    
    Signed-off-by: Linus Lüssing <linus.luessing at web.de>
    Signed-off-by: Marek Lindner <lindner_marek at yahoo.de>
    Acked-by: Antonio Quartulli <ordex at autistici.org>
    Signed-off-by: Antonio Quartulli <ordex at autistici.org>

diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index 688a041..857e1b8 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -432,12 +432,16 @@ find_router:
 
 	switch (packet_type) {
 	case BATADV_UNICAST:
-		batadv_unicast_prepare_skb(skb, orig_node);
+		if (!batadv_unicast_prepare_skb(skb, orig_node))
+			goto out;
+
 		header_len = sizeof(struct batadv_unicast_packet);
 		break;
 	case BATADV_UNICAST_4ADDR:
-		batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node,
-						 packet_subtype);
+		if (!batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node,
+						      packet_subtype))
+			goto out;
+
 		header_len = sizeof(struct batadv_unicast_4addr_packet);
 		break;
 	default:

-- 
LinuxNextTracking


More information about the linux-merge mailing list