Skip to content

Commit 919f9f4

Browse files
TaeheeYooPaolo Abeni
authored andcommitted
eth: bnxt: fix out-of-range access of vnic_info array
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: 6619585 ("eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue restart logic") Signed-off-by: Taehee Yoo <[email protected]> Reviewed-by: Michael Chan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent f653b60 commit 919f9f4

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+2
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15651,7 +15651,7 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1565115651
cpr = &rxr->bnapi->cp_ring;
1565215652
cpr->sw_stats->rx.rx_resets++;
1565315653

15654-
for (i = 0; i <= bp->nr_vnics; i++) {
15654+
for (i = 0; i < bp->nr_vnics; i++) {
1565515655
vnic = &bp->vnic_info[i];
1565615656

1565715657
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)
1567915679
struct bnxt_vnic_info *vnic;
1568015680
int i;
1568115681

15682-
for (i = 0; i <= bp->nr_vnics; i++) {
15682+
for (i = 0; i < bp->nr_vnics; i++) {
1568315683
vnic = &bp->vnic_info[i];
1568415684
vnic->mru = 0;
1568515685
bnxt_hwrm_vnic_update(bp, vnic,

0 commit comments

Comments
 (0)