From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 692A31ABCC4; Thu, 6 Jun 2024 14:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683292; cv=none; b=srRzb2fRIz2/p+LiOAi9GvN5i/Ii7spqQPiviLIYs4hOx3tsXZyFBCx77nMAa+SFaTUqrc769W12XIkvw7qEHsfxR6CJwkJHLGoivvNYrzOh4vZ+knokOBi0KXAqvVrDEVS0rg2rqrd6U+qhj2PFSaRWOnfYEDREybucBJRmHO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683292; c=relaxed/simple; bh=pzQAreO9kdvwU+P6GdEY8uq+tkqGffmPa6F0ck7WqZ4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WJKAK1IdmT35f4gXZ++kKGjao0eGFv8bGUy2LGUVs+IYiRVU/ufLVenU5Btezz04gsbfxP92d3EjVVQWf4e32hJWLBCFMG+Br8KljRZGz++THsGMaztkPrM+5f4gz/T4+kQhKTV1QhgjKYvRJl0+R6uS82ITLF33RCkrWYZG6Nk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CmmLVqPl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CmmLVqPl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49630C2BD10; Thu, 6 Jun 2024 14:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717683292; bh=pzQAreO9kdvwU+P6GdEY8uq+tkqGffmPa6F0ck7WqZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CmmLVqPleSjofVUCo1XxwZ1tepfYaN2ipvVqVYOMRPw1PVvSA73wv7ipGg6jns0YG HiWrMelrZae0V2vTGobO5okOptKkik8xVbIpsWNimcZIZuprxy6r5ypIMfgTyhcEHP Z3+svSxFJAjUqcZi7PQCjkPMAwGhaNQaj/m78JIs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 233/744] usb: aqc111: stop lying about skb->truesize Date: Thu, 6 Jun 2024 15:58:25 +0200 Message-ID: <20240606131739.860951183@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240606131732.440653204@linuxfoundation.org> References: <20240606131732.440653204@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit 9aad6e45c4e7d16b2bb7c3794154b828fb4384b4 ] Some usb drivers try to set small skb->truesize and break core networking stacks. I replace one skb_clone() by an allocation of a fresh and small skb, to get minimally sized skbs, like we did in commit 1e2c61172342 ("net: cdc_ncm: reduce skb truesize in rx path") and 4ce62d5b2f7a ("net: usb: ax88179_178a: stop lying about skb->truesize") Fixes: 361459cd9642 ("net: usb: aqc111: Implement RX data path") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20240506135546.3641185-1-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/usb/aqc111.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 7b8afa589a53c..284375f662f1e 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -1141,17 +1141,15 @@ static int aqc111_rx_fixup(struct usbnet *dev, struct sk_buff *skb) continue; } - /* Clone SKB */ - new_skb = skb_clone(skb, GFP_ATOMIC); + new_skb = netdev_alloc_skb_ip_align(dev->net, pkt_len); if (!new_skb) goto err; - new_skb->len = pkt_len; + skb_put(new_skb, pkt_len); + memcpy(new_skb->data, skb->data, pkt_len); skb_pull(new_skb, AQ_RX_HW_PAD); - skb_set_tail_pointer(new_skb, new_skb->len); - new_skb->truesize = SKB_TRUESIZE(new_skb->len); if (aqc111_data->rx_checksum) aqc111_rx_checksum(new_skb, pkt_desc); -- 2.43.0