Subject: Re: [Bugme-new] [Bug 9174] New: linux-2.6.23-git11 kernel panic

From: Patrick McHardy <[email-masked]>
Date: Thu, 18 Oct 2007 12:58:42 +0200

Patrick McHardy wrote:
> Andrew Morton wrote:
>> On Wed, 17 Oct 2007 07:36:16 -0700 (PDT)
>> [email-masked] wrote:
>>
>>> http://bugzilla.kernel.org/show_bug.cgi?id=9174
>>>
>>>            Summary: linux-2.6.23-git11 kernel panic
>  >>
> 
>>> EIP is at packet_rcv_0x1a2/0x360
> 
> 
> Please find out on which device the packet socket is opened by
> looking at /proc/net/packet and comparing the Iface shown there
> to the ifindexes listed in "ip link list".

Well, he replied in private mail, the device in question is
an IPv6-over-IPv4 tunnel, which doesn't have any header_ops,
so the crash happens in dev_parse_header when dereferencing
them.

Signed-off-by: Patrick McHardy <[email-masked]>

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 39dd83b..452c88d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -827,7 +827,7 @@ static inline int dev_parse_header(const struct sk_buff *skb,
 {
 	const struct net_device *dev = skb->dev;
 
-	if (!dev->header_ops->parse)
+	if (!dev->header_ops || !dev->header_ops->parse)
 		return 0;
 	return dev->header_ops->parse(skb, haddr);
 }