Skip to content

Commit 58e453e

Browse files
Andrey VatoropinUlrich Hecht
authored andcommitted
be2net: pass wrb_params in case of OS2BMC
commit 7d277a7a58578dd62fd546ddaef459ec24ccae36 upstream. be_insert_vlan_in_pkt() is called with the wrb_params argument being NULL at be_send_pkt_to_bmc() call site.  This may lead to dereferencing a NULL pointer when processing a workaround for specific packet, as commit bc0c340 ("be2net: fix a Tx stall bug caused by a specific ipv6 packet") states. The correct way would be to pass the wrb_params from be_xmit(). Fixes: 760c295 ("be2net: Support for OS2BMC.") Cc: stable@vger.kernel.org Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru> Link: https://patch.msgid.link/20251119105015.194501-1-a.vatoropin@crpt.ru Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent 9a60d80 commit 58e453e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/net/ethernet/emulex/benet/be_main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,8 @@ static void be_xmit_flush(struct be_adapter *adapter, struct be_tx_obj *txo)
13011301
(adapter->bmc_filt_mask & BMC_FILT_MULTICAST)
13021302

13031303
static bool be_send_pkt_to_bmc(struct be_adapter *adapter,
1304-
struct sk_buff **skb)
1304+
struct sk_buff **skb,
1305+
struct be_wrb_params *wrb_params)
13051306
{
13061307
struct ethhdr *eh = (struct ethhdr *)(*skb)->data;
13071308
bool os2bmc = false;
@@ -1365,7 +1366,7 @@ static bool be_send_pkt_to_bmc(struct be_adapter *adapter,
13651366
* to BMC, asic expects the vlan to be inline in the packet.
13661367
*/
13671368
if (os2bmc)
1368-
*skb = be_insert_vlan_in_pkt(adapter, *skb, NULL);
1369+
*skb = be_insert_vlan_in_pkt(adapter, *skb, wrb_params);
13691370

13701371
return os2bmc;
13711372
}
@@ -1392,7 +1393,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev)
13921393
/* if os2bmc is enabled and if the pkt is destined to bmc,
13931394
* enqueue the pkt a 2nd time with mgmt bit set.
13941395
*/
1395-
if (be_send_pkt_to_bmc(adapter, &skb)) {
1396+
if (be_send_pkt_to_bmc(adapter, &skb, &wrb_params)) {
13961397
BE_WRB_F_SET(wrb_params.features, OS2BMC, 1);
13971398
wrb_cnt = be_xmit_enqueue(adapter, txo, skb, &wrb_params);
13981399
if (unlikely(!wrb_cnt))

0 commit comments

Comments
 (0)