* [PATCH net] bnx2x: Fix potential IRO array leak on removal
@ 2026-11-12 13:59 Guangshuo Li
2026-11-12 14:02 ` netdev-bot+sinfo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Guangshuo Li @ 2026-11-12 13:59 UTC (permalink / raw)
To: Sudarsana Kalluru, Manish Chopra, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel
Firmware initialization allocates a separate IRO array, but
bnx2x_release_firmware() only frees the other parsed tables. Removing
the device loses the array pointer with the netdev.
Free the IRO array with the remaining firmware tables.
This issue was found by our static analysis tool under development.
Fixes: 523224a3b3cd ("bnx2x, cnic, bnx2i: use new FW/HSI")
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 277c7bd9c6e7..c6afde9466be 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13489,6 +13489,7 @@ static int bnx2x_init_firmware(struct bnx2x *bp)
static void bnx2x_release_firmware(struct bnx2x *bp)
{
+ kfree(bp->iro_arr);
kfree(bp->init_ops_offsets);
kfree(bp->init_ops);
kfree(bp->init_data);
base-commit: 2e54b3e187300893688c2c7517894f5d96732e05
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net] bnx2x: Fix potential IRO array leak on removal
2026-11-12 13:59 [PATCH net] bnx2x: Fix potential IRO array leak on removal Guangshuo Li
@ 2026-11-12 14:02 ` netdev-bot+sinfo
2026-11-17 11:55 ` Daniel Machon
2026-11-18 1:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: netdev-bot+sinfo @ 2026-11-12 14:02 UTC (permalink / raw)
To: Guangshuo Li
Cc: Sudarsana Kalluru, Manish Chopra, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- What hardware the change was tested on. For driver fixes please
mention the device (and if relevant firmware version) used for
testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] bnx2x: Fix potential IRO array leak on removal
2026-11-12 13:59 [PATCH net] bnx2x: Fix potential IRO array leak on removal Guangshuo Li
2026-11-12 14:02 ` netdev-bot+sinfo
@ 2026-11-17 11:55 ` Daniel Machon
2026-11-18 1:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Daniel Machon @ 2026-11-17 11:55 UTC (permalink / raw)
To: Guangshuo Li
Cc: Sudarsana Kalluru, Manish Chopra, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
> Firmware initialization allocates a separate IRO array, but
> bnx2x_release_firmware() only frees the other parsed tables. Removing
> the device loses the array pointer with the netdev.
>
> Free the IRO array with the remaining firmware tables.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: 523224a3b3cd ("bnx2x, cnic, bnx2i: use new FW/HSI")
> Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
> ---
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> index 277c7bd9c6e7..c6afde9466be 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> @@ -13489,6 +13489,7 @@ static int bnx2x_init_firmware(struct bnx2x *bp)
>
> static void bnx2x_release_firmware(struct bnx2x *bp)
> {
> + kfree(bp->iro_arr);
> kfree(bp->init_ops_offsets);
> kfree(bp->init_ops);
> kfree(bp->init_data);
>
> base-commit: 2e54b3e187300893688c2c7517894f5d96732e05
Looks right, however bnx2x_release_firmware() is only ever called from the
remove path. So seems like net-next material.
For the fix:
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net] bnx2x: Fix potential IRO array leak on removal
2026-11-12 13:59 [PATCH net] bnx2x: Fix potential IRO array leak on removal Guangshuo Li
2026-11-12 14:02 ` netdev-bot+sinfo
2026-11-17 11:55 ` Daniel Machon
@ 2026-11-18 1:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-11-18 1:30 UTC (permalink / raw)
To: Guangshuo Li
Cc: skalluru, manishc, andrew+netdev, davem, edumazet, kuba, pabeni,
netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 12 Nov 2026 21:59:10 +0800 you wrote:
> Firmware initialization allocates a separate IRO array, but
> bnx2x_release_firmware() only frees the other parsed tables. Removing
> the device loses the array pointer with the netdev.
>
> Free the IRO array with the remaining firmware tables.
>
> This issue was found by our static analysis tool under development.
>
> [...]
Here is the summary with links:
- [net] bnx2x: Fix potential IRO array leak on removal
https://git.kernel.org/netdev/net-next/c/155ee7139278
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] 4+ messages in thread
end of thread, other threads:[~2026-11-18 1:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 13:59 [PATCH net] bnx2x: Fix potential IRO array leak on removal Guangshuo Li
2026-11-12 14:02 ` netdev-bot+sinfo
2026-11-17 11:55 ` Daniel Machon
2026-11-18 1:30 ` 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
all inboxes | Powered by JetHome®