From patchwork Thu Dec 2 16:38:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 73998 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6FA871007D7 for ; Fri, 3 Dec 2010 03:45:25 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757920Ab0LBQpG (ORCPT ); Thu, 2 Dec 2010 11:45:06 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:39000 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752816Ab0LBQpE (ORCPT ); Thu, 2 Dec 2010 11:45:04 -0500 Received: by wyb28 with SMTP id 28so8400314wyb.19 for ; Thu, 02 Dec 2010 08:45:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=HgldXfjMJgTLO2kc5yz+JMPYBXJj7NwldTHCwi9Xqtw=; b=Az3ATOsAoN0Vu6Um0oXvxs3FkWQqgPaen5Mm8fun/96ZbpLTFfo+rHDAwXTSvq3opr 4KoK/U7s5JpSajAlHcYU7X0RjMBlrJmhCvEgcfyo3HmNHU92ni7fX1kxVz8ovY6mqW+u wN5wHu8iyHhYv/ecYl0ZgJU3pPELItJe9Rz+A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=EmCZTSOwk/dDNbVcd2zNDEDmcZ9BruCse3eLGEtYBr5msRdGREN+8+AeK7VbBavq1K fqOyagxXAptWhr+LsWECl7jFY4nLTpdK4vMcLPor+597ZzCBLpU+8zp+YX22fqubJtdS 2LGOB5av6M32n7zCcXfF4o9gKM9Z+rYJhUHLg= Received: by 10.216.50.147 with SMTP id z19mr3701525web.38.1291307887876; Thu, 02 Dec 2010 08:38:07 -0800 (PST) Received: from [10.150.51.216] (gw0.net.jmsp.net [212.23.165.14]) by mx.google.com with ESMTPS id x15sm363351weq.31.2010.12.02.08.38.06 (version=SSLv3 cipher=RC4-MD5); Thu, 02 Dec 2010 08:38:06 -0800 (PST) Subject: Re: kernel panic with time-stamping in phy devices (monitor mode) From: Eric Dumazet To: Andrew Watts Cc: netdev@vger.kernel.org In-Reply-To: <252997.92320.qm@web111013.mail.gq1.yahoo.com> References: <252997.92320.qm@web111013.mail.gq1.yahoo.com> Date: Thu, 02 Dec 2010 17:38:04 +0100 Message-ID: <1291307884.2871.69.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Le jeudi 02 décembre 2010 à 08:05 -0800, Andrew Watts a écrit : > Hi. > > The 'time stamping in phy devices' code introduced in 2.6.36 > (c1f19b51d1d87f3e3bb7e6648f43f7d57ed2da6b et al.) triggers > kernel panics when wireless devices are placed in monitor mode > (tested with b43 and ath5k devices on a 32-bit system). > > To reproduce, set CONFIG_NETWORK_PHY_TIMESTAMPING=y and put a > wireless device into monitor mode: > > # ifconfig wlan0 down > # iwconfig wlan0 mode monitor > # ifconfig wlan0 up > > ~ Andy > > ============== > > [] ? __alloc_skb+0x53/0xf8 > [] ? b43_dma_rx+0x18a/0x342 [b43] > [] ? b43_do_interrupt_thread+0x420/0x92e [b43] > [] ? __dequeue_entity+0x31/0x35 > [] ? set_next_entity+0xad/0xbb > [] ? b43_interrupt_thread_handler+0x18/0x2b [b43] > [] ? irq_thread+0xb6/0x19e > [] ? schedule+0x254/0x566 > [] ? irq_thread+0x0/0x19e > [] ? kthread+0x67/0x69 > [] ? kthread+0x0/0x69 > [] ? kernel_thread_helper+0x6/0x18 > Code: 4c 24 14 8b 88 a8 00 00 00 89 4c 24 10 89 54 24 0c 8b > 40 50 89 44 24 08 8b 45 04 89 44 24 04 c7 04 24 30 74 7a c1 > e8 b5 d2 11 00 <0f> 0b eb fe 55 89 e5 56 53 83 ec 24 8b 88 > a0 00 00 00 8b 58 54 > EIP: [] skb_push+0x7d/0x81 SS:ESP 0068:cee01d78 > ---[ end trace af1c99818e62b195 ]--- > Kernel panic - not syncing: Fatal exception in interrupt > Pid: 6674, comm: irq/18-b43 Tainted: G D 2.6.36.1 > Call Trace: > [] ? printk+0x28/0x2a > [] panic+0x57/0x150 > [] oops_begin+0x0/0x40 > [] die+0x49/0x5d > [] do_trap+0x84/0xad > [] ? do_invalid_op+0x0/0x93 > [] do_invalid_op+0x86/0x93 > [] ? skb_push+0x7d/0x81 > [] error_code+0x65/0x6c > [] ? skb_push+0x7d/0x81 > [] ? skb_defer_rx_timestamp+0x12/0x5a > [] skb_defer_rx_timestamp+0x12/0x5a > [] netif_receive_skb+0x1f/0x47 > [] ieee80211_rx+0x661/0x8e1 > [] ? ssb_pci_read32+0x19/0x31 [ssb] > [] ? b43_tsf_read+0x2a/0x47 [b43] > [] b43_rx+0x24c/0x5eb [b43] > [] ? __alloc_skb+0x53/0xf8 > [] b43_dma_rx+0x18a/0x342 [b43] > [] b43_do_interrupt_thread+0x420/0x92e [b43] > [] ? __dequeue_entity+0x31/0x35 > [] ? set_next_entity+0xad/0xbb > [] b43_interrupt_thread_handler+0x18/0x2b [b43] > [] irq_thread+0xb6/0x19e > [] ? schedule+0x254/0x566 > [] ? irq_thread+0x0/0x19e > [] kthread+0x67/0x69 > [] ? kthread+0x0/0x69 > [] kernel_thread_helper+0x6/0x18 > > Thanks for the report Please try following patch. --- 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 diff --git a/net/core/timestamping.c b/net/core/timestamping.c index dac7ed6..a710ab0 100644 --- a/net/core/timestamping.c +++ b/net/core/timestamping.c @@ -96,7 +96,10 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb) struct phy_device *phydev; unsigned int type; - skb_push(skb, ETH_HLEN); + if (skb->data - ETH_HLEN < skb->head) + return false; + + __skb_push(skb, ETH_HLEN); type = classify(skb);