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

batman at open-mesh.org batman at open-mesh.org
Thu Feb 20 00:22:56 CET 2014


The following commit has been merged in the master branch:
commit f1791425cf0bcda43ab9a9a37df1ad3ccb1f6654
Author: Antonio Quartulli <antonio at meshcoding.com>
Date:   Thu Jan 30 00:12:24 2014 +0100

    batman-adv: properly check pskb_may_pull return value
    
    pskb_may_pull() returns 1 on success and 0 in case of failure,
    therefore checking for the return value being negative does
    not make sense at all.
    
    This way if the function fails we will probably read beyond the current
    skb data buffer. Fix this by doing the proper check.
    
    Signed-off-by: Antonio Quartulli <antonio at meshcoding.com>
    Signed-off-by: Marek Lindner <mareklindner at neomailbox.ch>

diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 1ed9f7c..c26f073 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -688,7 +688,7 @@ static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv,
 	int is_old_ttvn;
 
 	/* check if there is enough data before accessing it */
-	if (pskb_may_pull(skb, hdr_len + ETH_HLEN) < 0)
+	if (!pskb_may_pull(skb, hdr_len + ETH_HLEN))
 		return 0;
 
 	/* create a copy of the skb (in case of for re-routing) to modify it. */

-- 
LinuxNextTracking


More information about the linux-merge mailing list