Skip to contentSkip to conversation

igb: Initialize mailbox message for VF reset

PATCH In review Tony Nguyen 2 participants 2 messages Dec 8, 2022 – Dec 11, 2022

Subsystems (2)
lore
Share & tools
lore

Tony Nguyen

author maintainer
#0 lore raw

PATCH 1/1 igb: Initialize mailbox message for VF reset

When a MAC address is not assigned to the VF, that portion of the message sent to the VF is not set. The memory, however, is allocated from the stack meaning that information may be leaked to the VM. Initialize the message buffer to 0 so that no information is passed to the VM in this case.

Fixes 6ddbc4cf1f4d ("igb: Indicate failure on vf reset for empty mac address")
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
index 97290fc0fddd..3c0c35ecea10 100644
@@ -7525,7 +7525,7 @@ static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
 {
 	struct e1000_hw *hw = &adapter->hw;
 	unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses;
-	u32 reg, msgbuf[3];
+	u32 reg, msgbuf[3] = {};
 	u8 *addr = (u8 *)(&msgbuf[1]);
 
 	/* process all the same items cleared in a function level reset */
Signature · 6 lines
2.35.1

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Tony Nguyen

When a MAC address is not assigned to the VF, that portion of the message sent to the VF is not set. The memory, however, is allocated from the stack meaning that information may be leaked to the VM. Initialize the message buffer to 0 so that no information is passed to the VM in this case.

Fixes 6ddbc4cf1f4d ("igb: Indicate failure on vf reset for empty mac address")
---
  drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_main.c +0 -0
index 97290fc0fddd..3c0c35ecea10 100644

drivers/net/ethernet/intel/igb/igb_main.c static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf) · line 7531

Quoted 8 lines
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
@@ -7525,7 +7525,7 @@ static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
  {
  	struct e1000_hw *hw = &adapter->hw;
  	unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses;
-	u32 reg, msgbuf[3];
+	u32 reg, msgbuf[3] = {};
  	u8 *addr = (u8 *)(&msgbuf[1]);
 
  	/* process all the same items cleared in a function level reset */

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan