]> git.hungrycats.org Git - linux/commitdiff
[NETLINK]: In netlink_trim(), verify that SKB is not on a list.
authorDavid S. Miller <davem@nuts.davemloft.net>
Tue, 28 Sep 2004 07:47:53 +0000 (00:47 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Tue, 28 Sep 2004 07:47:53 +0000 (00:47 -0700)
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c

index 8bcf3f30f306889923e6f11ecacb70b66d9ad334..1a7b78619b85d109b3a171a347f7e74b21818ed8 100644 (file)
@@ -540,6 +540,12 @@ static inline void netlink_trim(struct sk_buff *skb, int allocation)
 {
        int delta = skb->end - skb->tail;
 
+       /* If the packet is charged to a socket, the modification
+        * of truesize below is illegal and will corrupt socket
+        * buffer accounting state.
+        */
+       BUG_ON(skb->list != NULL);
+
        if (delta * 2 < skb->truesize)
                return;
        if (pskb_expand_head(skb, 0, -delta, allocation))