patch-2.1.102 linux/net/core/rtnetlink.c

Next file: linux/net/core/scm.c
Previous file: linux/net/README
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.101/linux/net/core/rtnetlink.c linux/net/core/rtnetlink.c
@@ -348,6 +348,8 @@
 	}
 
 	if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) {
+		int rlen;
+
 		if (link->dumpit == NULL)
 			link = &(rtnetlink_links[PF_UNSPEC][type]);
 
@@ -364,7 +366,10 @@
 				atomic_dec(&rtnl_rlockct);
 			return -1;
 		}
-		skb_pull(skb, NLMSG_ALIGN(nlh->nlmsg_len));
+		rlen = NLMSG_ALIGN(nlh->nlmsg_len);
+		if (rlen > skb->len)
+			rlen = skb->len;
+		skb_pull(skb, rlen);
 		return -1;
 	}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov