From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73FC7C2D0CE for ; Sun, 29 Dec 2019 14:19:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 470D920722 for ; Sun, 29 Dec 2019 14:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577629174; bh=raHb7k2s/QGy2ljr5L6eWzriR4O1pDqXJ/kwwGS8HXM=; h=Subject:To:Cc:From:Date:List-ID:From; b=mek+Ha6obMoQJ28yqJN10UEleolhUWREuuXhesO/zLioiwKkd7HwgPga1ZBXqG+QW 9Y3ij2mHNTNurmjPxE3MkcjGxxHSkj6pcpgrN9NHYYqTStBtYCWgwEvdk9/TMLHzX0 4DSRP0Z8WHu88nHk45vqE1kLB1ttF9Z2eRWj7eyM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726410AbfL2OTe (ORCPT ); Sun, 29 Dec 2019 09:19:34 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:55453 "EHLO wout4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbfL2OTd (ORCPT ); Sun, 29 Dec 2019 09:19:33 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 9FFAF44D; Sun, 29 Dec 2019 09:19:32 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 29 Dec 2019 09:19:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=B5BNJf FbqmwIIB+t2+yWdeueCKEy1tQrxJ726Q92SQ8=; b=dPZyAULWjq6COo/pG/ATOU TkDIhAGCoorPa1/5aHqCmoaKd5N4fEzdpng9L7U2OBuNF5JW4Fa7tIoWoKVoHyeM k32ExdJGjv9IJZrnpMgCvv8/HWy3YBZ1MYdhJMtPf6UsNEVxLWOGNpLpYB6sygDv CUrA1vASn/N16SCCM3MRmvu8p7506FsOazoJBLrZhkCbhCVfiKTJ4+b+bDFUgPrQ JoQLTxNzbmh80vKQgxuxtd2NWBimr/FXyWHJ4qLHF9VumkNVGB4nuHKvinfsfxSV vMljw+Q0WOH9wmhK3HBUUeiQFZbDttU9/UbDhwKufHHxbpdp+2Xc0nBrqdfyeymQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdeffedgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtjeenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepkeefrdekiedrkeelrd dutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomhen ucevlhhushhtvghrufhiiigvpedu X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id DF94130608D7; Sun, 29 Dec 2019 09:19:31 -0500 (EST) Subject: FAILED: patch "[PATCH] usbip: Fix receive error in vhci-hcd when using" failed to apply to 4.9-stable tree To: suwan.kim027@gmail.com, gregkh@linuxfoundation.org, marmarek@invisiblethingslab.com, skhan@linuxfoundation.org, stable@vger.kernel.org Cc: From: Date: Sun, 29 Dec 2019 15:19:22 +0100 Message-ID: <1577629162172142@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.9-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 . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From d986294ee55d719562b20aabe15a39bf8f863415 Mon Sep 17 00:00:00 2001 From: Suwan Kim 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. Fixes: ea44d190764b ("usbip: Implement SG support to vhci-hcd and stub driver") Reported-by: Marek Marczykowski-Górecki Tested-by: Marek Marczykowski-Górecki Signed-off-by: Suwan Kim Acked-by: Shuah Khan Cc: stable Link: https://lore.kernel.org/r/20191213023055.19933-2-suwan.kim027@gmail.com Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/usbip/usbip_common.c b/drivers/usb/usbip/usbip_common.c index 6532d68e8808..e4b96674c405 100644 --- a/drivers/usb/usbip/usbip_common.c +++ b/drivers/usb/usbip/usbip_common.c @@ -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)