From: Mark Lord <mlord@pobox.com>
To: nic_swsd@realtek.com, netdev@vger.kernel.org,
Linux Kernel <linux-kernel@vger.kernel.org>
Cc: stable@vger.kernel.org
Subject: [PATCH] drivers/net/usb/r8152 fix broken rx checksums
Date: Wed, 26 Oct 2016 18:36:57 -0400 [thread overview]
Message-ID: <987cfbab-2b48-e28c-1706-967cb2051d63@pobox.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]
The r8152 driver has been broken since (approx) 3.6.16,
when support was added for hardware rx checksum on newer chip versions.
Symptoms include random segfaults and silent data corruption over NFS.
This does not work on the VER_02 dongle I have here
when used with a slow embedded system CPU.
Google reveals others reporting similar issues on Raspberry Pi.
So, disable hardware rx checksum for VER_02, and fix
an obvious coding error for IPV6 checksums in the same function.
Because this bug results in silent data corruption,
it is a good candidate for back-porting to -stable >= 3.16.xx.
Patch attached (to deal with buggy mailer) and also below for review.
Signed-off-by: Mark Lord <mlord@pobox.com>
--- old/drivers/net/usb/r8152.c 2016-09-30 04:20:43.000000000 -0400
+++ linux/drivers/net/usb/r8152.c 2016-10-26 14:15:44.932517676 -0400
@@ -1645,7 +1645,7 @@
u8 checksum = CHECKSUM_NONE;
u32 opts2, opts3;
- if (tp->version == RTL_VER_01)
+ if (tp->version == RTL_VER_01 || tp->version == RTL_VER_02)
goto return_result;
opts2 = le32_to_cpu(rx_desc->opts2);
@@ -1660,7 +1660,7 @@
checksum = CHECKSUM_NONE;
else
checksum = CHECKSUM_UNNECESSARY;
- } else if (RD_IPV6_CS) {
+ } else if (opts2 & RD_IPV6_CS) {
if ((opts2 & RD_UDP_CS) && !(opts3 & UDPF))
checksum = CHECKSUM_UNNECESSARY;
else if ((opts2 & RD_TCP_CS) && !(opts3 & TCPF))
[-- Attachment #2: drivers_net_usb_r8152_checksums.patch --]
[-- Type: text/x-patch, Size: 1306 bytes --]
The r8152 driver has been broken since (approx) 3.6.16,
when support was added for hardware rx checksum on newer chip versions.
Symptoms include random segfaults and silent data corruption over NFS.
This does not work on the VER_02 dongle I have here
when used with a slow embedded system CPU.
Google reveals others reporting similar issues on Raspberry Pi.
So, disable hardware rx checksum for VER_02, and fix
an obvious coding error for IPV6 checksums in the same function.
Because this bug results in silent data corruption,
it is a good candidate for back-porting to -stable >= 3.16.xx.
Signed-off-by: Mark Lord <mlord@pobox.com>
--- old/drivers/net/usb/r8152.c 2016-09-30 04:20:43.000000000 -0400
+++ linux/drivers/net/usb/r8152.c 2016-10-26 14:15:44.932517676 -0400
@@ -1645,7 +1645,7 @@
u8 checksum = CHECKSUM_NONE;
u32 opts2, opts3;
- if (tp->version == RTL_VER_01)
+ if (tp->version == RTL_VER_01 || tp->version == RTL_VER_02)
goto return_result;
opts2 = le32_to_cpu(rx_desc->opts2);
@@ -1660,7 +1660,7 @@
checksum = CHECKSUM_NONE;
else
checksum = CHECKSUM_UNNECESSARY;
- } else if (RD_IPV6_CS) {
+ } else if (opts2 & RD_IPV6_CS) {
if ((opts2 & RD_UDP_CS) && !(opts3 & UDPF))
checksum = CHECKSUM_UNNECESSARY;
else if ((opts2 & RD_TCP_CS) && !(opts3 & TCPF))
next reply other threads:[~2016-10-26 22:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-26 22:36 Mark Lord [this message]
2016-10-26 22:54 ` Mark Lord
2016-10-30 21:22 ` David Miller
2016-10-30 23:48 ` Paul Bolle
2016-10-30 23:28 ` [PATCH net] r8152: Fix broken RX checksums Mark Lord
2016-10-31 0:57 ` David Miller
2016-10-31 2:07 ` Mark Lord
2016-10-31 3:53 ` David Miller
2016-10-31 8:14 ` Hayes Wang
2016-10-31 13:24 ` Mark Lord
2016-11-02 18:29 ` Mark Lord
2016-11-04 12:13 ` Mark Lord
[not found] ` <201611030159.uA31x0np004648@rtits1.realtek.com>
2016-11-03 8:56 ` Hayes Wang
2016-11-03 11:43 ` Mark Lord
2016-11-04 13:50 ` Mark Lord
2016-11-04 20:13 ` Mark Lord
[not found] ` <201611041425.uA4EPwCw018176@rtits1.realtek.com>
2016-11-09 13:09 ` Hayes Wang
2016-11-09 13:19 ` Mark Lord
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=987cfbab-2b48-e28c-1706-967cb2051d63@pobox.com \
--to=mlord@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
--cc=stable@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
all inboxes | Powered by JetHome®