Patch "benet: fix return value check in be_lancer_xmit_workarounds()" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    benet: fix return value check in be_lancer_xmit_workarounds()

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     benet-fix-return-value-check-in-be_lancer_xmit_worka.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 44baf95bf9e229042f20ead3e6c05f037f7378cb
Author: Yuanjun Gong <ruc_gongyuanjun@xxxxxxx>
Date:   Tue Jul 25 11:27:26 2023 +0800

    benet: fix return value check in be_lancer_xmit_workarounds()
    
    [ Upstream commit 5c85f7065718a949902b238a6abd8fc907c5d3e0 ]
    
    in be_lancer_xmit_workarounds(), it should go to label 'tx_drop'
    if an unexpected value is returned by pskb_trim().
    
    Fixes: 93040ae5cc8d ("be2net: Fix to trim skb for padded vlan packets to workaround an ASIC Bug")
    Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@xxxxxxx>
    Link: https://lore.kernel.org/r/20230725032726.15002-1-ruc_gongyuanjun@xxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 0defd519ba62e..7fa057d379c1a 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1138,7 +1138,8 @@ static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
 	    (lancer_chip(adapter) || BE3_chip(adapter) ||
 	     skb_vlan_tag_present(skb)) && is_ipv4_pkt(skb)) {
 		ip = (struct iphdr *)ip_hdr(skb);
-		pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len));
+		if (unlikely(pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len))))
+			goto tx_drop;
 	}
 
 	/* If vlan tag is already inlined in the packet, skip HW VLAN



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux