mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ratheesh Kannoth <rkannoth@marvell.com>
To: Slavin Liu <bolin.liu@seu.edu.cn>
Cc: <sgoutham@marvell.com>, <gakula@marvell.com>,
	<sbhatta@marvell.com>, <andrew+netdev@lunn.ch>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] octeontx2-af: validate MCS blocks before initialization
Date: Mon, 14 Sep 2026 08:41:49 +0530	[thread overview]
Message-ID: <aqdl9TJwfk7BrFOU@rkannoth-OptiPlex-7090> (raw)
In-Reply-To: <20260913125206.109985-1-bolin.liu@seu.edu.cn>

On 2026-09-13 at 18:22:06, Slavin Liu (bolin.liu@seu.edu.cn) wrote:
> The MCS count is a maximum successful ID plus one, not proof of a
> dense device set. Validate the complete range before programming any
> block, so a failed lower-ID probe cannot cause a NULL dereference.
>
> Detected by static analysis and reviewed with AI-assisted source auditing.
>
> Fixes: 080bbd19c9dd ("octeontx2-af: cn10k: mcs: Add mailboxes for port related operations")
> Assisted-by: LLM
> Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
> ---
>  drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c b/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
> index fce22e314cac..0ee2d0d698e5 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
> @@ -889,6 +889,11 @@ int rvu_mcs_init(struct rvu *rvu)
>  		rvu_mcs_set_lmac_bmap(rvu);
>  	}
>
> +	for (mcs_id = 0; mcs_id < rvu->mcs_blk_cnt; mcs_id++) {
> +		if (!mcs_get_pdata(mcs_id))
> +			return -ENODEV;
> +	}
Do we need to move this up to apply for cn10kb as well ?
> +
>  	/* Install default tcam bypass entry and set port to operational mode */
>  	for (mcs_id = 0; mcs_id < rvu->mcs_blk_cnt; mcs_id++) {
>  		mcs = mcs_get_pdata(mcs_id);

  reply	other threads:[~2026-09-14  3:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-13 12:52 Slavin Liu
2026-09-14  3:11 ` Ratheesh Kannoth [this message]
2026-09-14 13:37 ` netdev-bot+sashiko
2026-09-16  6:50 ` [EXTERNAL] " Geethasowjanya Akula

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=aqdl9TJwfk7BrFOU@rkannoth-OptiPlex-7090 \
    --to=rkannoth@marvell.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bolin.liu@seu.edu.cn \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    /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

all inboxes | Powered by JetHome®