Re: PROBLEM: System call 'sendmsg' of process ospfd (quagga) causeskernel oops

From: Eric Dumazet
Date: Wed Oct 19 2011 - 03:18:40 EST


Le mercredi 19 octobre 2011 Ã 03:09 -0400, David Miller a Ãcrit :
> From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxxx>
> Date: Tue, 18 Oct 2011 15:45:37 +0200
>
> > On Tue, Oct 18, 2011 at 02:56:00PM +0200, Eric Dumazet wrote:
> >>
> >> I am ok by this way, but we might hit another similar problem elsewhere.
> >>
> >> (igmp.c ip6_output, ...)
> >>
> >> We effectively want to remove LL_ALLOCATED_SPACE() usage and obfuscate
> >> code...
> >
> > Here's another idea, provide a helper to do the skb allocation
> > and the skb_reserve in one go. That way this ugliness would only
> > need to be done once.
>
> Someone please test this:
>
> --------------------
> net: Fix crashes on devices which dynamically change needed headroom.
>
> One such device is IP_GRE.
>
> The problem is that we evaluate the device characteristics twice, once
> to determine the allocation size, and once to do the skb_reserve().
>
> Combine these into one operation using a helper function.
>
> With help from Eric Dumazet and Herbert Xu.
>
> Reported-by: Reported-by: Elmar Vonlanthen <evonlanthen@xxxxxxxxx>
> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
>



Seems fine (Maybe do the +15 in caller site ?), but we also have other
problematic cases, using alloc_skb() only...



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/