Control: tag -1 upstream patch moreinfo

Does the attached patch fix it?  Instructions for building a patched
kernel package can be found at:
https://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-common-official

Ben.

-- 
Ben Hutchings
Reality is just a crutch for people who can't handle science fiction.
From abc83f38abd2d62ce5a443e0b2a40a76d0b75cb8 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <b...@decadent.org.uk>
Date: Wed, 7 Feb 2018 21:05:37 +0000
Subject: [PATCH] r8152: Fix conditions for setting ip_summed =
 CHECKSUM_UNNECESSARY

Currently r8152_rx_csum() returns CHECKSUM_UNNECESSARY for any packet
which the hardware reports as being IPv4 and not having a layer-4
checksum error, even if the layer-4 protocol was not recognised.
This will incorrectly include, for example, SCTP packets.  It also
appears that some TCP packets with valid headers and bad checksums
also trigger this bug.

Use the same logic for IPv4 as for IPv6.  We don't need to check the
hardware IP header checksum flag because that's always checked in
software.

Reported-by: Vincent Danjean <vdanj...@debian.org>
Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
---
 drivers/net/usb/r8152.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 0657203ffb91..c3c8e2d74f8b 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1845,16 +1845,7 @@ static u8 r8152_rx_csum(struct r8152 *tp, struct rx_desc *rx_desc)
 	opts2 = le32_to_cpu(rx_desc->opts2);
 	opts3 = le32_to_cpu(rx_desc->opts3);
 
-	if (opts2 & RD_IPV4_CS) {
-		if (opts3 & IPF)
-			checksum = CHECKSUM_NONE;
-		else if ((opts2 & RD_UDP_CS) && (opts3 & UDPF))
-			checksum = CHECKSUM_NONE;
-		else if ((opts2 & RD_TCP_CS) && (opts3 & TCPF))
-			checksum = CHECKSUM_NONE;
-		else
-			checksum = CHECKSUM_UNNECESSARY;
-	} else if (opts2 & RD_IPV6_CS) {
+	if (opts2 & (RD_IPV4_CS | RD_IPV6_CS)) {
 		if ((opts2 & RD_UDP_CS) && !(opts3 & UDPF))
 			checksum = CHECKSUM_UNNECESSARY;
 		else if ((opts2 & RD_TCP_CS) && !(opts3 & TCPF))

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to