Skip to contentSkip to conversation

FAILED: patch "[PATCH] usbip: Fix receive error in vhci-hcd when using" failed to apply to 4.4-stable tree

PATCH [email protected] 3 participants 3 messages Dec 29, 2019

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From d986294ee55d719562b20aabe15a39bf8f863415 Mon Sep 17 00:00:00 2001
From: Suwan Kim <[email protected]>
Date: Fri, 13 Dec 2019 11:30:54 +0900
Subject: [PATCH] usbip: Fix receive error in vhci-hcd when using
scatter-gather
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When vhci uses SG and receives data whose size is smaller than SG buffer size, it tries to receive more data even if it acutally receives all the data from the server. If then, it erroneously adds error event and triggers connection shutdown.

vhci-hcd should check if it received all the data even if there are more SG entries left. So, check if it receivces all the data from the server in for_each_sg() loop.

drivers/usb/usbip/usbip_common.c +3 -0
index 6532d68e8808..e4b96674c405 100644
@@ -727,6 +727,9 @@ int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb)
 
 			copy -= recv;
 			ret += recv;
+
+			if (!copy)
+				break;
 		}
 
 		if (ret != size)
#1 lore raw
Quoted 5 lines · On Sun, Dec 29, 2019 at 03:19:21PM +0100, [email protected] wrote:

The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

I think the bug this commit fixes (part of ea44d190764b commit) is not present in 4.4, nor 4.9 branches.
In short: no need to backport it to 4.4 or 4.9 branch.

Quoted 48 lines

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From d986294ee55d719562b20aabe15a39bf8f863415 Mon Sep 17 00:00:00 2001
From: Suwan Kim <[email protected]>
Date: Fri, 13 Dec 2019 11:30:54 +0900
Subject: [PATCH] usbip: Fix receive error in vhci-hcd when using
scatter-gather
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When vhci uses SG and receives data whose size is smaller than SG buffer size, it tries to receive more data even if it acutally receives all the data from the server. If then, it erroneously adds error event and triggers connection shutdown.

vhci-hcd should check if it received all the data even if there are more SG entries left. So, check if it receivces all the data from the server in for_each_sg() loop.

drivers/usb/usbip/usbip_common.c +3 -0
index 6532d68e8808..e4b96674c405 100644
@@ -727,6 +727,9 @@ int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb)
 
 			copy -= recv;
 			ret += recv;
+
+			if (!copy)
+				break;
 		}
 
 		if (ret != size)
Signature · 5 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
maintainer
#2 lore raw
Quoted 11 lines · Marek Marczykowski-Górecki
Quoted 5 lines · On Sun, Dec 29, 2019 at 03:19:21PM +0100, [email protected] wrote:

The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

I think the bug this commit fixes (part of ea44d190764b commit) is not present in 4.4, nor 4.9 branches.
In short: no need to backport it to 4.4 or 4.9 branch.

Correct. We don't have to backport it to 4.4 and 4.9

thanks,
-- Shuah