]> git.neil.brown.name Git - history.git/commitdiff
[NET]: Add missing skb_share_check() calls to econet/bpqether/lapbether/ipconfig.
authorDavid S. Miller <davem@nuts.ninka.net>
Mon, 6 Oct 2003 21:00:23 +0000 (14:00 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Mon, 6 Oct 2003 21:00:23 +0000 (14:00 -0700)
drivers/net/hamradio/bpqether.c
drivers/net/wan/lapbether.c
net/econet/af_econet.c
net/ipv4/ipconfig.c

index 107ff6a6431ea95a7f317c7e69f6d0c6ab1ac534..69324efda9c92981418ec1ed1d99a38b607f30c0 100644 (file)
@@ -175,6 +175,9 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
        struct ethhdr *eth;
        struct bpqdev *bpq;
 
+       if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
+               return NET_RX_DROP;
+
        if (!pskb_may_pull(skb, sizeof(struct ethhdr)))
                goto drop;
 
index 271b7c64ebca32a6ca85530552ac10254ee8ac5a..8359af4defeb7dbacc155c327c18a3d3ae6e0882 100644 (file)
@@ -89,6 +89,9 @@ static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
        int len, err;
        struct lapbethdev *lapbeth;
 
+       if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
+               return NET_RX_DROP;
+
        if (!pskb_may_pull(skb, 2))
                goto drop;
 
index a2d29b793aacc189c0a1a33cd99f55d4eb5e2abe..2e92207962f62392d225672f17415fe5a88e7266 100644 (file)
@@ -1015,16 +1015,17 @@ static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
        struct sock *sk;
        struct ec_device *edev = dev->ec_ptr;
 
-       if (!edev) {
-               kfree_skb(skb);
-               return 0;
-       }
+       if (skb->pkt_type == PACKET_OTHERHOST)
+               goto drop;
 
-       if (!pskb_may_pull(skb, sizeof(struct ec_framehdr))) {
-               /* Frame is too small to be any use */
-               kfree_skb(skb);
-               return 0;
-       }
+       if (!edev)
+               goto drop;
+
+       if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
+               return NET_RX_DROP;
+
+       if (!pskb_may_pull(skb, sizeof(struct ec_framehdr)))
+               goto drop;
 
        hdr = (struct ec_framehdr *) skb->data;
 
@@ -1037,13 +1038,15 @@ static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
        }
 
        sk = ec_listening_socket(hdr->port, hdr->src_stn, hdr->src_net);
-       if (!sk) {
-               kfree_skb(skb);
-               return 0;
-       }
+       if (!sk)
+               goto drop;
 
        return ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb, 
                               hdr->port);
+
+drop:
+       kfree_skb(skb);
+       return 0;
 }
 
 static struct packet_type econet_packet_type = {
index 7954bd0bae58ed24b4f272b01d025cf203c4d2a6..60a392490ec9fed3d0f046824c5cd92958586b9d 100644 (file)
@@ -415,6 +415,9 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
        unsigned char *sha, *tha;               /* s for "source", t for "target" */
        struct ic_device *d;
 
+       if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
+               return NET_RX_DROP;
+
        if (!pskb_may_pull(skb, sizeof(arphdr)))
                goto drop;
 
@@ -823,6 +826,9 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
        if (skb->pkt_type == PACKET_OTHERHOST)
                goto drop;
 
+       if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
+               return NET_RX_DROP;
+
        if (!pskb_may_pull(skb,
                           sizeof(struct iphdr) +
                           sizeof(struct udphdr)))