From: Stephen Hemminger Date: Thu, 8 Dec 2005 23:21:39 +0000 (-0800) Subject: [NET]: Fix NULL pointer deref in checksum debugging. X-Git-Tag: v2.6.15-rc6~145^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=246a421207007a034da9b8cfa578bc00d16a9553;p=linux-2.6 [NET]: Fix NULL pointer deref in checksum debugging. The problem I was seeing turned out to be that skb->dev is NULL when the checksum is being completed in user context. This happens because the reference to the device is dropped (to allow it to be released when packets are in the queue). Because skb->dev was NULL, the netdev_rx_csum_fault was panicing on deref of dev->name. How about this? Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 0b48e294aa..a5efc9ae01 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1113,7 +1113,8 @@ out: void netdev_rx_csum_fault(struct net_device *dev) { if (net_ratelimit()) { - printk(KERN_ERR "%s: hw csum failure.\n", dev->name); + printk(KERN_ERR "%s: hw csum failure.\n", + dev ? dev->name : ""); dump_stack(); } }