Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: aqc111: stop lying about skb->truesize

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 <edumazet@google.com>
Link: https://lore.kernel.org/r/20240506135546.3641185-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
9aad6e45 eb709b5f

+3 -5
+3 -5
drivers/net/usb/aqc111.c
··· 1141 1141 continue; 1142 1142 } 1143 1143 1144 - /* Clone SKB */ 1145 - new_skb = skb_clone(skb, GFP_ATOMIC); 1144 + new_skb = netdev_alloc_skb_ip_align(dev->net, pkt_len); 1146 1145 1147 1146 if (!new_skb) 1148 1147 goto err; 1149 1148 1150 - new_skb->len = pkt_len; 1149 + skb_put(new_skb, pkt_len); 1150 + memcpy(new_skb->data, skb->data, pkt_len); 1151 1151 skb_pull(new_skb, AQ_RX_HW_PAD); 1152 - skb_set_tail_pointer(new_skb, new_skb->len); 1153 1152 1154 - new_skb->truesize = SKB_TRUESIZE(new_skb->len); 1155 1153 if (aqc111_data->rx_checksum) 1156 1154 aqc111_rx_checksum(new_skb, pkt_desc); 1157 1155