Skip to content

Commit c364df2

Browse files
esbendavem330
authored andcommitted
net: ll_temac: Fix TX BD buffer overwrite
Just as the initial check, we need to ensure num_frag+1 buffers available, as that is the number of buffers we are going to use. This fixes a buffer overflow, which might be seen during heavy network load. Complete lockup of TEMAC was reproducible within about 10 minutes of a particular load. Fixes: 84823ff ("net: ll_temac: Fix race condition causing TX hang") Cc: [email protected] # v5.4+ Signed-off-by: Esben Haabendal <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 28d9fab commit c364df2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/xilinx/ll_temac_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
861861
smp_mb();
862862

863863
/* Space might have just been freed - check again */
864-
if (temac_check_tx_bd_space(lp, num_frag))
864+
if (temac_check_tx_bd_space(lp, num_frag + 1))
865865
return NETDEV_TX_BUSY;
866866

867867
netif_wake_queue(ndev);

0 commit comments

Comments
 (0)