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 B51C982C76; Thu, 13 Jun 2024 12:15:09 +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=1718280909; cv=none; b=DodSXZj+wBKuLbHIekpv3vcMAIH+OOMdOPf5GA3oHudPvMyPL/MfuwEvnxZAn99HPIELHgQHQKUIq5I5JwcbNF/7B25SXnTeYOVNk3iSbZQy+IStuWHOrlaPbLoKftmMDoK43yzGuqN7mmtNl2gN2mzG3BomQAx/mXYNmRT+/3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718280909; c=relaxed/simple; bh=fIhR0j0rc9JWZdfeo4gkgko0XsG/QUzp4AkF10HiigQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lt6LfUhd5SaYrc/Z14qQA6JnZYABRZsdvHYk+tY/gn+9ngtvmPvWz/fyN4zaZvtj19HnSVz7n2CyNyjgm8BdHFWMLM6uyfHIlfJRtvXQH+yXmO0rGJzAzF7q5XmYpgN4XMXHlQKE1ZLANH47NNotIDYW2dtjyQRUO0YKIQqnYaM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2XexvQNd; 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="2XexvQNd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E99EC2BBFC; Thu, 13 Jun 2024 12:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718280909; bh=fIhR0j0rc9JWZdfeo4gkgko0XsG/QUzp4AkF10HiigQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2XexvQNdvZ6MZ2M5dEtLxjcJub9GkPjlAznNFF2CPlP1iBO0EDSqOxBKS3+bvpstL nncAF6JzQcrX/2g52wWptQ+t8XgaGi9YMkZoKUdSMZNxPbl8dWUnJm1qMEx/Gz5EK4 y9BJwOfIOdT+p5PSSewYAtn1Gi2GV5sL5yAP5i08= 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 5.10 076/317] usb: aqc111: stop lying about skb->truesize Date: Thu, 13 Jun 2024 13:31:34 +0200 Message-ID: <20240613113250.489190049@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113247.525431100@linuxfoundation.org> References: <20240613113247.525431100@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 5.10-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 4ea02116be182..895d4f5166f99 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