From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757528Ab1JRLtu (ORCPT ); Tue, 18 Oct 2011 07:49:50 -0400 Received: from helcar.apana.org.au ([209.40.204.226]:33929 "EHLO fornost.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754854Ab1JRLts (ORCPT ); Tue, 18 Oct 2011 07:49:48 -0400 Date: Tue, 18 Oct 2011 13:49:45 +0200 From: Herbert Xu To: Eric Dumazet Cc: Elmar Vonlanthen , linux-kernel@vger.kernel.org, netdev , Timo =?iso-8859-1?Q?Ter=E4s?= Subject: Re: PROBLEM: System call 'sendmsg' of process ospfd (quagga) causes kernel oops Message-ID: <20111018114945.GA16359@gondor.apana.org.au> References: <1318604266.2223.29.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <1318905032.2571.35.camel@edumazet-laptop> <20111018093411.GA15165@gondor.apana.org.au> <1318932093.2657.26.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <20111018100527.GA15383@gondor.apana.org.au> <1318933423.2657.44.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <20111018104504.GA15913@gondor.apana.org.au> <1318937878.2657.50.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1318937878.2657.50.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt