From patchwork Wed Jun 17 15:23:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 28793 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 99CD2B7139 for ; Thu, 18 Jun 2009 01:23:41 +1000 (EST) Received: by ozlabs.org (Postfix) id 82C43DDDB2; Thu, 18 Jun 2009 01:23:41 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id E4332DDDA2 for ; Thu, 18 Jun 2009 01:23:40 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752549AbZFQPXb (ORCPT ); Wed, 17 Jun 2009 11:23:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752411AbZFQPXa (ORCPT ); Wed, 17 Jun 2009 11:23:30 -0400 Received: from mail.vyatta.com ([76.74.103.46]:38568 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752241AbZFQPXa (ORCPT ); Wed, 17 Jun 2009 11:23:30 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.vyatta.com (Postfix) with ESMTP id 008974F4015; Wed, 17 Jun 2009 08:23:33 -0700 (PDT) X-Virus-Scanned: amavisd-new at tahiti.vyatta.com Received: from mail.vyatta.com ([127.0.0.1]) by localhost (mail.vyatta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LqudQPEFgB-q; Wed, 17 Jun 2009 08:23:28 -0700 (PDT) Received: from nehalam (pool-71-117-243-208.ptldor.fios.verizon.net [71.117.243.208]) by mail.vyatta.com (Postfix) with ESMTP id 294AF4F4011; Wed, 17 Jun 2009 08:23:28 -0700 (PDT) Date: Wed, 17 Jun 2009 08:23:27 -0700 From: Stephen Hemminger To: Arnaldo Carvalho de Melo , David Miller Cc: netdev@vger.kernel.org Subject: [RFC] skbuff: skb_mac_header_was_set is always true on >32 bit Message-ID: <20090617082327.196eda07@nehalam> Organization: Vyatta X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Looking at the crash in log_martians(), one suspect is that the check for mac header being set is not correct. The value of mac_header defaults to 0 on allocation, therefore skb_mac_header_was_set will always be true on platforms using NET_SKBUFF_USES_OFFSET. Arnaldo, is this correct? Signed-off-by: Stephen Hemminger Acked-by: Arnaldo Carvalho de Melo --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/net/core/skbuff.c 2009-06-17 08:16:46.235188728 -0700 +++ b/net/core/skbuff.c 2009-06-17 08:17:25.810314332 -0700 @@ -201,6 +201,10 @@ struct sk_buff *__alloc_skb(unsigned int skb->data = data; skb_reset_tail_pointer(skb); skb->end = skb->tail + size; +#ifdef NET_SKBUFF_DATA_USES_OFFSET + skb->mac_header = ~0U; +#endif + /* make sure we initialize shinfo sequentially */ shinfo = skb_shinfo(skb); atomic_set(&shinfo->dataref, 1);