Received: by 10.223.164.202 with SMTP id h10csp246894wrb; Tue, 7 Nov 2017 05:53:37 -0800 (PST) X-Google-Smtp-Source: ABhQp+RMGDLTJMCQHFVvU8kLZKqMAi5gOBgz6U83YoVIlalWX9rLUvr4RB2cRvGwevAFhsCazy1G X-Received: by 10.101.81.6 with SMTP id f6mr19251714pgq.64.1510062817881; Tue, 07 Nov 2017 05:53:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510062817; cv=none; d=google.com; s=arc-20160816; b=RmjeyDc+cdTZOfKHS5/Pa3CVQeBDguIe5UOtoQnPrL23tov8AJ/q78KtMl4NZIYJSX Jo/VdWZzBQ7qFx9im2RUqPic4+uLVv5Yp8ilqhF2IZESbn4B0soqXqZg/H4uMgI1M2JU tyIUwJeB7Yl0uiUlatzjNBYxTDZ9sCx3hNg0aOZfwei6pWRAE7g0iLn+o2gqqiYlpaGH QdVsZluyKHuqBkWhs/tRbZKSxZvw3Y+mfXFWyS7w3lrCrjT3q6i22JfjBY7kJC93EMHl ymKzGA8HciONQ1foAVg/gD2DYKahmitDbZYRVdoNcp8+jcBq//CjZU0FQSEA+yH4DyO/ DKoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=x5ycJehIEvvBdG7KeNMo/FvDAitG1hLDZLoZikiStLw=; b=BwdNgosKZeHEyTbK1M+vmN933YtJquWL7AUkHNYqh9OFVpCb5c3RAhTF1nu5zJ/2ta Of82M/dFRvQKl+zM5nXsHC5FRJ17t16FLic4VGnzg9jaqbOcZwpkIFbBgYi4rVL8VayH vXt4/srozMHI4D4ttGPu9+BDGTJEoIlzdGBKqVuraG8GrDM8SP/gvfByu1C93WZanKwg gPPm543pDWE0mgV7keX4ukjHpxdSaGHBaGBbx120oB6YcNGJiKZU73hW3yk4JMnY9n1H Hl9xVCIaRTVkjEwPQXhFIhRzgdXZZKXfraNPrMsGXoGwZ14EieI/xL8gKDYfCxZVpqNG ++3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UIU32uAs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o187si1212483pga.831.2017.11.07.05.53.24; Tue, 07 Nov 2017 05:53:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UIU32uAs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752958AbdKGMsL (ORCPT + 91 others); Tue, 7 Nov 2017 07:48:11 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:50324 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751602AbdKGMsJ (ORCPT ); Tue, 7 Nov 2017 07:48:09 -0500 Received: by mail-lf0-f66.google.com with SMTP id a132so14318121lfa.7; Tue, 07 Nov 2017 04:48:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=x5ycJehIEvvBdG7KeNMo/FvDAitG1hLDZLoZikiStLw=; b=UIU32uAs56G4cd4cx3OUMFfaDh3gKEl3sz6Qo+8aS+BLhN+iN953uvadPaJh+RMDfz qaxu1yX6n152GnmY7ueDZYgXziKnX6WCm/DRHBf6e4DavlOvzycJu6vBHik6aylqv6N2 senUGmCeNEGk5nMX4w1nTaaH178o5mfgC8tocQFuC7j7AYvTEm/ewq9kwwo5UY9rY2Bk Ox7479E0uAXPPgtJ/cqsDx0jBPl+x3aQTH9QVn3FdHfUugTL5KMtcM1+2CpMnHTYa4Ix GcEz1CZkl8XyAk9CJuLzfqGl7ddXa2MYO7AioFTXt2MY/kmDd4/4wk6DMwuF4INgbnZP U/XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=x5ycJehIEvvBdG7KeNMo/FvDAitG1hLDZLoZikiStLw=; b=i1UlgScJasIuk2hXztSsiNEoWkFMBTL7itAOTNK3gpeE73k+SKqNLL8H4MTLT96ilF V7G1PnoT5Qm2uvVHomkl9nFbcbZdo3yALwhR91QYs1v4faRY9jnBvRQgIl6MKa5o8dxV tTu3HuTUokU4lsTClGQ+ISVmC5h8cYyK+i+1Zhw6xroF61VVd9uipD/kqUp+KPZOOuBt B5gV7XmAj8KCLKGexhtM0qMgO19tkhTl7fVhc3kP+dIaYcPkruz3c4qgeE54fLRjsGTx XbOS1H1ktcmmoalOqHL7CrirX/S1nLy2AKaNqzwyki9dxx/e25opjgWdCProsc3dUHh0 5ZOw== X-Gm-Message-State: AMCzsaVSEWW8ZuSjt4zgrekWknHv6BtbV+Q5qcx4howFkNLIJiJszAgs bdUqHpHGHhxlia3vSjg2vq8= X-Received: by 10.46.85.215 with SMTP id g84mr7431076lje.114.1510058887075; Tue, 07 Nov 2017 04:48:07 -0800 (PST) Received: from localhost.localdomain ([193.213.155.210]) by smtp.gmail.com with ESMTPSA id 13sm228770ljv.10.2017.11.07.04.48.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 04:48:06 -0800 (PST) From: Kristian Evensen To: bjorn@mork.no, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Kristian Evensen Subject: [PATCH net] qmi_wwan: Add missing skb_reset_mac_header-call Date: Tue, 7 Nov 2017 13:47:56 +0100 Message-Id: <20171107124756.3029-1-kristian.evensen@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When we receive a packet on a QMI device in raw IP mode, we should call skb_reset_mac_header() to ensure that skb->mac_header contains a valid offset in the packet. While it shouldn't really matter, the packets have no MAC header and the interface is configured as-such, it seems certain parts of the network stack expects a "good" value in skb->mac_header. Without the skb_reset_mac_header() call added in this patch, for example shaping traffic (using tc) triggers the following oops on the first received packet: [ 303.642957] skbuff: skb_under_panic: text:8f137918 len:177 put:67 head:8e4b0f00 data:8e4b0eff tail:0x8e4b0fb0 end:0x8e4b1520 dev:wwan0 [ 303.655045] Kernel bug detected[#1]: [ 303.658622] CPU: 1 PID: 1002 Comm: logd Not tainted 4.9.58 #0 [ 303.664339] task: 8fdf05e0 task.stack: 8f15c000 [ 303.668844] $ 0 : 00000000 00000001 0000007a 00000000 [ 303.674062] $ 4 : 8149a2fc 8149a2fc 8149ce20 00000000 [ 303.679284] $ 8 : 00000030 3878303a 31623465 20303235 [ 303.684510] $12 : ded731e3 2626a277 00000000 03bd0000 [ 303.689747] $16 : 8ef62b40 00000043 8f137918 804db5fc [ 303.694978] $20 : 00000001 00000004 8fc13800 00000003 [ 303.700215] $24 : 00000001 8024ab10 [ 303.705442] $28 : 8f15c000 8fc19cf0 00000043 802cc920 [ 303.710664] Hi : 00000000 [ 303.713533] Lo : 74e58000 [ 303.716436] epc : 802cc920 skb_panic+0x58/0x5c [ 303.721046] ra : 802cc920 skb_panic+0x58/0x5c [ 303.725639] Status: 11007c03 KERNEL EXL IE [ 303.729823] Cause : 50800024 (ExcCode 09) [ 303.733817] PrId : 0001992f (MIPS 1004Kc) [ 303.737892] Modules linked in: rt2800pci rt2800mmio rt2800lib qcserial ppp_async option usb_wwan rt2x00pci rt2x00mmio rt2x00lib rndis_host qmi_wwan ppp_generic nf_nat_pptp nf_conntrack_pptp nf_conntrack_ipv6 mt76x2i Process logd (pid: 1002, threadinfo=8f15c000, task=8fdf05e0, tls=77b3eee4) [ 303.962509] Stack : 00000000 80408990 8f137918 000000b1 00000043 8e4b0f00 8e4b0eff 8e4b0fb0 [ 303.970871] 8e4b1520 8fec1800 00000043 802cd2a4 6e000045 00000043 00000000 8ef62000 [ 303.979219] 8eef5d00 8ef62b40 8fea7300 8f137918 00000000 00000000 0002bb01 793e5664 [ 303.987568] 8ef08884 00000001 8fea7300 00000002 8fc19e80 8eef5d00 00000006 00000003 [ 303.995934] 00000000 8030ba90 00000003 77ab3fd0 8149dc80 8004d1bc 8f15c000 8f383700 [ 304.004324] ... [ 304.006767] Call Trace: [ 304.009241] [<802cc920>] skb_panic+0x58/0x5c [ 304.013504] [<802cd2a4>] skb_push+0x78/0x90 [ 304.017783] [<8f137918>] 0x8f137918 [ 304.021269] Code: 00602825 0c02a3b4 24842888 <000c000d> 8c870060 8c8200a0 0007382b 00070336 8c88005c [ 304.031034] [ 304.032805] ---[ end trace b778c482b3f0bda9 ]--- [ 304.041384] Kernel panic - not syncing: Fatal exception in interrupt [ 304.051975] Rebooting in 3 seconds.. While the oops is for a 4.9-kernel, I was able to trigger the same oops with net-next as of yesterday. Signed-off-by: Kristian Evensen --- drivers/net/usb/qmi_wwan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index db7279d5b250..5b22645c7c8c 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -499,6 +499,7 @@ static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb) return 1; } if (rawip) { + skb_reset_mac_header(skb); skb->dev = dev->net; /* normally set by eth_type_trans */ skb->protocol = proto; return 1; -- 2.11.0 From 1583460467240465683@xxx Wed Nov 08 01:46:18 +0000 2017 X-GM-THRID: 1582170674487065849 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread