Subject: Re: 2.6.25-rc: Null dereference in ip_defrag

From: Patrick McHardy <[email-masked]>
Date: Mon, 17 Mar 2008 18:51:57 +0100

Denis V. Lunev wrote:
> On Mon, 2008-03-17 at 18:43 +0100, Patrick McHardy wrote:
>> Pavel Emelyanov wrote:
>>
>>  > Can you check with this patch, please (untested, but should work)?
>>
>> This is getting pretty ugly. Shouldn't
>>
>> int ip_defrag(struct sk_buff *skb, u32 user)
>> {
>> ...
>> -         net = skb->dev->nd_net;
>> +         net = skb->dev ? skb->dev->nd_net : skb->dst->dev->nd_net;
>>>From my POW the we can just get skb->dst->dev. Could we?
> 
> I think that on IP level dealing with fragments we always have the
> destination entry. I'll recheck this tomorrow.

Unfortunately no, on the receive path connection tracking
will call ip_defrag before routing took place.