Skip to content

Commit

Permalink
[NET]: Fix NULL pointer deref in checksum debugging.
Browse files Browse the repository at this point in the history
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 <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Dec 8, 2005
1 parent 1f064a8 commit 246a421
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,8 @@ int skb_checksum_help(struct sk_buff *skb, int inward)
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 : "<unknown>");
dump_stack();
}
}
Expand Down

0 comments on commit 246a421

Please sign in to comment.