Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755824AbcJ3X2d (ORCPT ); Sun, 30 Oct 2016 19:28:33 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:51047 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752800AbcJ3X2a (ORCPT ); Sun, 30 Oct 2016 19:28:30 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=subject:to :references:cc:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; q=dns; s=sasl; b=B9UVEF smKfESx7+MYueO7FzvOzD7ORx+Pz2x9Lt8Lry9POzyNhMncKC8Qs2Sp7BT288Npp fAf7OY5wnqjk+5IVBssAy3p5yIB/yoBC9yAtMEbzj7iTXrCjIB6Fj/WFxArWLwJZ c8l4LP0VKkIYIe0HL6DV4Nozt+Fn1FoUiZF/Q= Subject: [PATCH net] r8152: Fix broken RX checksums. To: nic_swsd@realtek.com, netdev@vger.kernel.org, Linux Kernel References: <987cfbab-2b48-e28c-1706-967cb2051d63@pobox.com> Cc: stable@vger.kernel.org From: Mark Lord Message-ID: <9fb6be7b-95f3-6e59-c0f4-1d6c3357416d@pobox.com> Date: Sun, 30 Oct 2016 19:28:27 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <987cfbab-2b48-e28c-1706-967cb2051d63@pobox.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: 9020F390-9EF8-11E6-8903-92296462E9F6-82205200!pb-sasl1.pobox.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1338 Lines: 37 The r8152 driver has been broken since (approx) 3.16.xx when support was added for hardware RX checksums on newer chip versions. Symptoms include random segfaults and silent data corruption over NFS. The hardware checksum logig does not work on the VER_02 dongles 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 support 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 --- 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))