From: Stephen Hemminger <stephen@networkplumber.org>
To: Mohammad Shuab Siddique <mohammad-shuab.siddique@broadcom.com>
Cc: dev@dpdk.org, kishore.padmanabha@broadcom.com,
Chenna Arnoori <chenna.arnoori@broadcom.com>,
stable@dpdk.org
Subject: Re: [PATCH v2 4/5] net/bnxt: fix bounds in MAC pool index and flow parsing
Date: Mon, 21 Sep 2026 08:50:50 -0700 [thread overview]
Message-ID: <20260921085050.4ec87519@phoenix.local> (raw)
In-Reply-To: <20260921022420.1034071-5-Mohammad-Shuab.Siddique@broadcom.com>
On Sun, 20 Sep 2026 20:24:19 -0600
Mohammad Shuab Siddique <mohammad-shuab.siddique@broadcom.com> wrote:
> From: Chenna Arnoori <chenna.arnoori@broadcom.com>
>
> Two independent out-of-bounds issues in the driver:
>
> - bnxt_mac_addr_add_op() indexed bp->vnic_info[pool] with a
> caller-supplied pool before validating it against bp->max_vnics, and
> before checking bp->vnic_info was even allocated yet (it is NULL
> until the port is started). The existing "if (!vnic)" check was
> always false, since vnic held the address of an array element and
> is never NULL. Reorder to check dev_started/vnic_info first, then
> bounds-check pool against max_vnics before indexing.
>
> - bnxt_flow_non_void_item()/bnxt_flow_non_void_action() looped
> unconditionally until a non-VOID item/action was found, walking off
> the end of a pattern/actions array that lacked a terminating END
> item. Bound the skip loop and stop advancing once the limit is hit.
>
> Fixes: 51fafb89a9a0 ("net/bnxt: get rid of ff pools and use VNIC info array")
> Fixes: 5c1171c97216 ("net/bnxt: refactor filter/flow")
> Cc: stable@dpdk.org
>
> Signed-off-by: Chenna Arnoori <chenna.arnoori@broadcom.com>
> Signed-off-by: Mohammad Shuab Siddique <mohammad-shuab.siddique@broadcom.com>
> ---
[PATCH v2 4/5] net/bnxt: fix bounds in MAC pool index and flow
parsing
Warning: the bounded VOID skip does not bound the walk. The outer
loops in bnxt_filter_type_check() and
bnxt_validate_and_parse_flow_type() run while type != END. After 256
VOIDs the helper returns a VOID item, and the loop calls it again at
item + 1. A pattern without END is still walked off the end, and
non-VOID items are never counted. The rte_flow API requires the END
terminator. Drop this half of the patch.
The added "if (!cur) return NULL" paths return a value that no
caller checks.
Warning: in bnxt_mac_addr_add_op() the pool bounds check comes after
the dev_started early return. An invalid pool added while the port
is stopped returns 0, is recorded in mac_pool_sel, and then fails
later in bnxt_restore_mac_filters() at dev_start. Validate pool
against bp->max_vnics before the dev_started test. The
bp->vnic_info == NULL test after dev_started is dead code.
next prev parent reply other threads:[~2026-09-21 15:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 3:27 [PATCH 0/5] net/bnxt: fix flow, Rx and naming bounds issues Mohammad Shuab Siddique
2026-09-18 3:27 ` [PATCH 1/5] net/bnxt: fix stack exhaustion in flow stats Mohammad Shuab Siddique
2026-09-18 3:27 ` [PATCH 2/5] net/bnxt: fix bounds on TPA aggregation ID from completions Mohammad Shuab Siddique
2026-09-18 3:27 ` [PATCH 3/5] net/bnxt: harden sprintf bounds for device memory names Mohammad Shuab Siddique
2026-09-18 3:27 ` [PATCH 4/5] net/bnxt: fix bounds in MAC pool index and flow parsing Mohammad Shuab Siddique
2026-09-18 3:27 ` [PATCH 5/5] net/bnxt: fix TPA agg Rx descriptor and VNIC query bounds Mohammad Shuab Siddique
2026-09-21 2:24 ` [PATCH v2 0/5] net/bnxt: fix flow, Rx and naming bounds issues Mohammad Shuab Siddique
2026-09-21 2:24 ` [PATCH v2 1/5] net/bnxt: fix stack exhaustion in flow stats Mohammad Shuab Siddique
2026-09-21 2:24 ` [PATCH v2 2/5] net/bnxt: fix bounds on TPA aggregation ID from completions Mohammad Shuab Siddique
2026-09-21 2:24 ` [PATCH v2 3/5] net/bnxt: harden sprintf bounds for device memory names Mohammad Shuab Siddique
2026-09-21 15:49 ` Stephen Hemminger
2026-09-21 2:24 ` [PATCH v2 4/5] net/bnxt: fix bounds in MAC pool index and flow parsing Mohammad Shuab Siddique
2026-09-21 15:50 ` Stephen Hemminger [this message]
2026-09-21 2:24 ` [PATCH v2 5/5] net/bnxt: fix TPA agg Rx descriptor and VNIC query bounds Mohammad Shuab Siddique
2026-09-29 0:24 ` [PATCH v3 0/5] net/bnxt: fix flow, Rx and naming bounds issues Mohammad Shuab Siddique
2026-09-29 0:24 ` [PATCH v3 1/5] net/bnxt: fix stack exhaustion in flow stats Mohammad Shuab Siddique
2026-09-29 0:24 ` [PATCH v3 2/5] net/bnxt: validate TPA aggregation ID from completions Mohammad Shuab Siddique
2026-09-29 0:24 ` [PATCH v3 3/5] net/bnxt: harden sprintf bounds for device memory names Mohammad Shuab Siddique
2026-09-29 0:24 ` [PATCH v3 4/5] net/bnxt: fix bounds in MAC address pool index Mohammad Shuab Siddique
2026-09-29 0:24 ` [PATCH v3 5/5] net/bnxt: fix TPA agg Rx descriptor and VNIC query bounds Mohammad Shuab Siddique
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260921085050.4ec87519@phoenix.local \
--to=stephen@networkplumber.org \
--cc=chenna.arnoori@broadcom.com \
--cc=dev@dpdk.org \
--cc=kishore.padmanabha@broadcom.com \
--cc=mohammad-shuab.siddique@broadcom.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox