Skip to content

Commit 9aad6e4

Browse files
edumazetkuba-moo
authored andcommitted
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 1e2c611 ("net: cdc_ncm: reduce skb truesize in rx path") and 4ce62d5 ("net: usb: ax88179_178a: stop lying about skb->truesize") Fixes: 361459c ("net: usb: aqc111: Implement RX data path") Signed-off-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent eb709b5 commit 9aad6e4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/net/usb/aqc111.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,17 +1141,15 @@ static int aqc111_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
11411141
continue;
11421142
}
11431143

1144-
/* Clone SKB */
1145-
new_skb = skb_clone(skb, GFP_ATOMIC);
1144+
new_skb = netdev_alloc_skb_ip_align(dev->net, pkt_len);
11461145

11471146
if (!new_skb)
11481147
goto err;
11491148

1150-
new_skb->len = pkt_len;
1149+
skb_put(new_skb, pkt_len);
1150+
memcpy(new_skb->data, skb->data, pkt_len);
11511151
skb_pull(new_skb, AQ_RX_HW_PAD);
1152-
skb_set_tail_pointer(new_skb, new_skb->len);
11531152

1154-
new_skb->truesize = SKB_TRUESIZE(new_skb->len);
11551153
if (aqc111_data->rx_checksum)
11561154
aqc111_rx_checksum(new_skb, pkt_desc);
11571155

0 commit comments

Comments
 (0)