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

From: Herbert Xu
Date: Tue Oct 18 2011 - 07:49:48 EST


On Tue, Oct 18, 2011 at 01:37:58PM +0200, Eric Dumazet wrote:
>
> In the bug we try to fix, we have :
>
> skb = sock_alloc_send_skb(sk, ... + LL_ALLOCATED_SPACE(rt->dst.dev)
>
> ... < increase of dev->needed_headroom by another cpu/task >
>
> skb_reserve(skb, LL_RESERVED_SPACE(rt->dst.dev));

OK, in that case one fix would be to replace LL_ALLOCATED_SPACE
with its two constiuents so that they may be stored in local
variables for later use.

hlen = LL_HEADROOM(skb);
tlen = LL_TAILROOM(skb);
skb_alloc_send_skb(sk, ... + LL_ALIGN(hlen + tlen));

skb_reserve(skb, LL_ALIGN(hlen));

Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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/