netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] eth: bnxt: fix out-of-range access of vnic_info array
@ 2025-03-16  2:58 Taehee Yoo
  2025-03-16 23:03 ` Michael Chan
  2025-03-21 20:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Taehee Yoo @ 2025-03-16  2:58 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev,
	michael.chan, pavan.chebbi
  Cc: ap420073, somnath.kotur

The bnxt_queue_{start | stop}() access vnic_info as much as allocated,
which indicates bp->nr_vnics.
So, it should not reach bp->vnic_info[bp->nr_vnics].

Fixes: 661958552eda ("eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue restart logic")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 55f553debd3b..0ddc3d41e2d8 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -15651,7 +15651,7 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
 	cpr = &rxr->bnapi->cp_ring;
 	cpr->sw_stats->rx.rx_resets++;
 
-	for (i = 0; i <= bp->nr_vnics; i++) {
+	for (i = 0; i < bp->nr_vnics; i++) {
 		vnic = &bp->vnic_info[i];
 
 		rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic, true);
@@ -15679,7 +15679,7 @@ static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx)
 	struct bnxt_vnic_info *vnic;
 	int i;
 
-	for (i = 0; i <= bp->nr_vnics; i++) {
+	for (i = 0; i < bp->nr_vnics; i++) {
 		vnic = &bp->vnic_info[i];
 		vnic->mru = 0;
 		bnxt_hwrm_vnic_update(bp, vnic,
-- 
2.34.1


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

* Re: [PATCH net] eth: bnxt: fix out-of-range access of vnic_info array
  2025-03-16  2:58 [PATCH net] eth: bnxt: fix out-of-range access of vnic_info array Taehee Yoo
@ 2025-03-16 23:03 ` Michael Chan
  2025-03-21 20:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Chan @ 2025-03-16 23:03 UTC (permalink / raw)
  To: Taehee Yoo
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev,
	pavan.chebbi, somnath.kotur

[-- Attachment #1: Type: text/plain, Size: 464 bytes --]

On Sat, Mar 15, 2025 at 7:58 PM Taehee Yoo <ap420073@gmail.com> wrote:
>
> The bnxt_queue_{start | stop}() access vnic_info as much as allocated,
> which indicates bp->nr_vnics.
> So, it should not reach bp->vnic_info[bp->nr_vnics].
>
> Fixes: 661958552eda ("eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue restart logic")
> Signed-off-by: Taehee Yoo <ap420073@gmail.com>

Thanks.
Reviewed-by: Michael Chan <michael.chan@broadcom.com>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4196 bytes --]

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

* Re: [PATCH net] eth: bnxt: fix out-of-range access of vnic_info array
  2025-03-16  2:58 [PATCH net] eth: bnxt: fix out-of-range access of vnic_info array Taehee Yoo
  2025-03-16 23:03 ` Michael Chan
@ 2025-03-21 20:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-03-21 20:20 UTC (permalink / raw)
  To: Taehee Yoo
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev,
	michael.chan, pavan.chebbi, somnath.kotur

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Sun, 16 Mar 2025 02:58:37 +0000 you wrote:
> The bnxt_queue_{start | stop}() access vnic_info as much as allocated,
> which indicates bp->nr_vnics.
> So, it should not reach bp->vnic_info[bp->nr_vnics].
> 
> Fixes: 661958552eda ("eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue restart logic")
> Signed-off-by: Taehee Yoo <ap420073@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net] eth: bnxt: fix out-of-range access of vnic_info array
    https://git.kernel.org/netdev/net/c/919f9f497dbc

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:[~2025-03-21 20:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-16  2:58 [PATCH net] eth: bnxt: fix out-of-range access of vnic_info array Taehee Yoo
2025-03-16 23:03 ` Michael Chan
2025-03-21 20:20 ` 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).