]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[ATM] CLIP: Do not refer freed skbuff in clip_mkip() (CVE-2006-4997)
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Fri, 13 Oct 2006 23:13:36 +0000 (01:13 +0200)
committerAdrian Bunk <bunk@stusta.de>
Fri, 13 Oct 2006 23:13:36 +0000 (01:13 +0200)
In clip_mkip(), skb->dev is dereferenced after clip_push(),
which frees up skb.

Advisory: AD_LAB-06009 (<adlab@venustech.com.cn>).

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
net/atm/clip.c

index 1842a4ef9cb88e261fc30e9053e003ba66c3fa26..b10474d6ef528d4eec753478411b6f57ad825d92 100644 (file)
@@ -507,9 +507,11 @@ static int clip_mkip(struct atm_vcc *vcc,int timeout)
                else {
                        unsigned int len = skb->len;
 
+                       skb_get(skb);
                        clip_push(vcc,skb);
                        PRIV(skb->dev)->stats.rx_packets--;
                        PRIV(skb->dev)->stats.rx_bytes -= len;
+                       kfree_skb(skb);
                }
        return 0;
 }