netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emil Goode <emilgoode@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
	Ming Lei <ming.lei@canonical.com>,
	Mark Brown <broonie@linaro.org>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Glen Turner <gdt@gdt.id.au>
Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Emil Goode <emilgoode@gmail.com>
Subject: [PATCH] net: asix: fix bad header length bug
Date: Thu,  6 Feb 2014 13:56:24 +0100	[thread overview]
Message-ID: <1391691384-8486-1-git-send-email-emilgoode@gmail.com> (raw)

The AX88772B occasionally send rx packets that cross urb boundaries
and the remaining partial packet is sent with no header.
When the buffer with a partial packet is of less number of octets
than the value of hard_header_len the buffer is discarded by the
usbnet module. This is causing dropped packages and error messages
in dmesg.

This can be reproduced by using ping with a packet size
between 1965-1976.

The bug has been reported here:

https://bugzilla.kernel.org/show_bug.cgi?id=29082

Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
 drivers/net/usb/asix_devices.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index 9765a7d..120bb29 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -455,6 +455,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
 	dev->net->ethtool_ops = &ax88772_ethtool_ops;
 	dev->net->needed_headroom = 4; /* cf asix_tx_fixup() */
 	dev->net->needed_tailroom = 4; /* cf asix_tx_fixup() */
+	dev->net->hard_header_len = 0; /* Partial packets have no header */
 
 	embd_phy = ((dev->mii.phy_id & 0x1f) == 0x10 ? 1 : 0);
 
-- 
1.7.10.4

             reply	other threads:[~2014-02-06 12:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 12:56 Emil Goode [this message]
2014-02-06 13:19 ` [PATCH] net: asix: fix bad header length bug Igor Gnatenko
2014-02-06 15:28   ` David Laight
2014-02-06 22:41     ` Emil Goode
2014-02-07  9:38       ` Bjørn Mork
2014-02-07 13:53         ` Emil Goode
2014-02-07 14:40           ` David Laight
2014-02-06 13:37 ` David Laight
2014-02-06 15:02   ` Emil Goode

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391691384-8486-1-git-send-email-emilgoode@gmail.com \
    --to=emilgoode@gmail.com \
    --cc=broonie@linaro.org \
    --cc=davem@davemloft.net \
    --cc=gdt@gdt.id.au \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).