Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp271628pxb; Mon, 7 Feb 2022 10:55:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxa1XrFMZ93cXkGgCOMIF4DvJpaSeC46E61A2sl9QN01liRuqKcWiUsTYcVsxwYtuwRfOqA X-Received: by 2002:a05:6a00:98d:: with SMTP id u13mr752869pfg.83.1644260158836; Mon, 07 Feb 2022 10:55:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644260158; cv=none; d=google.com; s=arc-20160816; b=ATvnnZZEq22xZlFMDvC7OnvJbLCTKBGObFcimGB/v7FVPRlLt8CN06Hoqdsux8AAnh rBeIdDTwqpLddiqZhK6twtydKrW/oPkCkVWFYaI/So6tidhE/j/2L+NHfSvFiABjlbpD zS3dmyGQgSrDVC94PedV5XrTb8pa6XhPrsm26ndNFDV2R6YXz1QKjy8FVezV76vGUj7N xcO6fDBzzs9GVG86zVrwatYwc5wxiZ6khX7cZCRQP6cLjc7vMHEuPkKEA+RpeCTFyRgs eRBZQTQP07Q+12+yw2YOCuu1ix1EuhlVIzVA4JWm3Zuc460KDNcQDndYj98yz9XeWp10 4T5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AxBHq0pb8F6rfWx7cCae3LPDHE6haG7mO9tHTY5XqAA=; b=XAN11R3rLYVZYvBFZHiHJwau8Hnzi08eYj1rBxMlIfBotdsuP/zCOtMN8Shs1VN+Mk 7F1XuV8HD8JyyV26gyuvs88v/HD5j+LJPI23VxF2TdmVsOYcvYbB35gK2AnG8OO/4LvU ttGTmJ7wGYuBFFxyg4RmEibOWfrJ67r4WVmC0i0dYuoC1uqEbPxSrM1/QC9bAG9Din5K umXY0Hq+tfDCqx37Wf+zXIvWBYY9sXPkT4G31oCtl53WbKj09RJKyErHW7BxzKJecdaa wc+pzDb1RpTJRuvBt1GYklqcWTO2OaqQSpCo8KStg/X2dBKYcn5WHEveNayOBWn3yW1H V6yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V9JjXEs4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l22si10952177pfc.103.2022.02.07.10.55.47; Mon, 07 Feb 2022 10:55:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V9JjXEs4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357980AbiBDJ00 (ORCPT + 99 others); Fri, 4 Feb 2022 04:26:26 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:53032 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357734AbiBDJYt (ORCPT ); Fri, 4 Feb 2022 04:24:49 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 89AF1B836ED; Fri, 4 Feb 2022 09:24:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96763C340F0; Fri, 4 Feb 2022 09:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643966687; bh=iaE1IqOh0EjTj9ysylMCuepe6iN/kPDrrbFWOLuRBw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V9JjXEs4uzuFweWk87hqdGaVflQfdGzAj2ml4MKVgBpeoXi8ElK59sjn7hWSJa76u 4eUExb0ZOTI0ZD8G8VSAH9b8douA2acUzps8rj0Yjd+pQHQ6mBgae8Uge1poEuci9j LUq0hHBiiuZLAXdDukbDnrZ0W40rW9plkmUzhC5s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Georgi Valkov , Jan Kiszka , Jakub Kicinski Subject: [PATCH 5.15 21/32] ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback Date: Fri, 4 Feb 2022 10:22:31 +0100 Message-Id: <20220204091915.950075882@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220204091915.247906930@linuxfoundation.org> References: <20220204091915.247906930@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Georgi Valkov commit 63e4b45c82ed1bde979da7052229a4229ce9cabf upstream. When rx_buf is allocated we need to account for IPHETH_IP_ALIGN, which reduces the usable size by 2 bytes. Otherwise we have 1512 bytes usable instead of 1514, and if we receive more than 1512 bytes, ipheth_rcvbulk_callback is called with status -EOVERFLOW, after which the driver malfunctiones and all communication stops. Resolves ipheth 2-1:4.2: ipheth_rcvbulk_callback: urb status: -75 Fixes: f33d9e2b48a3 ("usbnet: ipheth: fix connectivity with iOS 14") Signed-off-by: Georgi Valkov Tested-by: Jan Kiszka Link: https://lore.kernel.org/all/B60B8A4B-92A0-49B3-805D-809A2433B46C@abv.bg/ Link: https://lore.kernel.org/all/24851bd2769434a5fc24730dce8e8a984c5a4505.1643699778.git.jan.kiszka@siemens.com/ Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/ipheth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/usb/ipheth.c @@ -121,7 +121,7 @@ static int ipheth_alloc_urbs(struct iphe if (tx_buf == NULL) goto free_rx_urb; - rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE, + rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, GFP_KERNEL, &rx_urb->transfer_dma); if (rx_buf == NULL) goto free_tx_buf; @@ -146,7 +146,7 @@ error_nomem: static void ipheth_free_urbs(struct ipheth_device *iphone) { - usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf, + usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, iphone->rx_buf, iphone->rx_urb->transfer_dma); usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf, iphone->tx_urb->transfer_dma); @@ -317,7 +317,7 @@ static int ipheth_rx_submit(struct iphet usb_fill_bulk_urb(dev->rx_urb, udev, usb_rcvbulkpipe(udev, dev->bulk_in), - dev->rx_buf, IPHETH_BUF_SIZE, + dev->rx_buf, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, ipheth_rcvbulk_callback, dev); dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;