netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/1] igb: Initialize mailbox message for VF reset
@ 2022-12-12 19:00 Tony Nguyen
  2022-12-13  8:47 ` Leon Romanovsky
  2022-12-14  4:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Tony Nguyen @ 2022-12-12 19:00 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Tony Nguyen, netdev, agraf, akihiko.odaki, yan, gregkh, security

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")
Reported-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index f8e32833226c..473158c09f1d 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7521,7 +7521,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 */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net 1/1] igb: Initialize mailbox message for VF reset
  2022-12-12 19:00 [PATCH net 1/1] igb: Initialize mailbox message for VF reset Tony Nguyen
@ 2022-12-13  8:47 ` Leon Romanovsky
  2022-12-14  4:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2022-12-13  8:47 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, kuba, pabeni, edumazet, netdev, agraf, akihiko.odaki, yan,
	gregkh, security

On Mon, Dec 12, 2022 at 11:00:31AM -0800, Tony Nguyen wrote:
> 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")
> Reported-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net 1/1] igb: Initialize mailbox message for VF reset
  2022-12-12 19:00 [PATCH net 1/1] igb: Initialize mailbox message for VF reset Tony Nguyen
  2022-12-13  8:47 ` Leon Romanovsky
@ 2022-12-14  4:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-14  4:00 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, kuba, pabeni, edumazet, netdev, agraf, akihiko.odaki, yan,
	gregkh, security

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 12 Dec 2022 11:00:31 -0800 you wrote:
> 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")
> Reported-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> 
> [...]

Here is the summary with links:
  - [net,1/1] igb: Initialize mailbox message for VF reset
    https://git.kernel.org/netdev/net/c/de5dc44370fb

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-14  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-12 19:00 [PATCH net 1/1] igb: Initialize mailbox message for VF reset Tony Nguyen
2022-12-13  8:47 ` Leon Romanovsky
2022-12-14  4:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).