public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: <edumazet@google.com>, <sumang@marvell.com>,
	<linux-kernel@vger.kernel.org>, <sbhatta@marvell.com>,
	<davem@davemloft.net>, <netdev@vger.kernel.org>,
	<pabeni@redhat.com>, <andrew+netdev@lunn.ch>,
	<sgoutham@marvell.com>
Subject: Re: [net-next,v6,01/13] octeontx2-af: npc: cn20k: Index management
Date: Thu, 29 Jan 2026 15:50:10 -0800	[thread overview]
Message-ID: <20260129155010.64297c67@kernel.org> (raw)
In-Reply-To: <aXrutHgsKEuJUlGK@rkannoth-OptiPlex-7090>

On Thu, 29 Jan 2026 10:53:00 +0530 Ratheesh Kannoth wrote:
> > When cnt is odd, the final loop iteration has i = cnt - 1, which means
> > subbank_srch_order[i + 1] writes to index cnt, which is out of bounds.
> >
> > For example with cnt = 5, the loop iterates with i = 0, 2, 4. At i = 4,
> > the array access subbank_srch_order[5] overflows the allocated array of
> > 5 elements.
> >
> > While CN20K hardware typically has 32 subbanks (even), the value is read
> > from a hardware register at npc_priv_init() without validation beyond
> > checking for zero. Could this lead to memory corruption if the hardware
> > reports an odd subbank count?  
> subbank count is 16 or 8, depending on SoC variant. i will add a WARN check on
> odd ?

Or just a comment may work to prevent the false positive

  reply	other threads:[~2026-01-29 23:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28  7:12 [PATCH net-next v6 00/13] NPC HW block support for cn20k Ratheesh Kannoth
2026-01-28  7:12 ` [PATCH net-next v6 01/13] octeontx2-af: npc: cn20k: Index management Ratheesh Kannoth
2026-01-28 11:27   ` ALOK TIWARI
2026-01-29  5:13   ` [net-next,v6,01/13] " Jakub Kicinski
2026-01-29  5:23     ` Ratheesh Kannoth
2026-01-29 23:50       ` Jakub Kicinski [this message]
2026-01-28  7:12 ` [PATCH net-next v6 02/13] octeontx2-af: npc: cn20k: KPM profile changes Ratheesh Kannoth
2026-01-29  5:13   ` [net-next,v6,02/13] " Jakub Kicinski
2026-01-28  7:12 ` [PATCH net-next v6 03/13] octeontx2-af: npc: cn20k: Add default profile Ratheesh Kannoth
2026-01-28  7:12 ` [PATCH net-next v6 04/13] octeontx2-af: npc: cn20k: MKEX profile support Ratheesh Kannoth
2026-01-28  7:12 ` [PATCH net-next v6 05/13] octeontx2-af: npc: cn20k: Allocate default MCAM indexes Ratheesh Kannoth
2026-01-28  7:12 ` [PATCH net-next v6 06/13] octeontx2-af: npc: cn20k: Use common APIs Ratheesh Kannoth
2026-01-28  7:12 ` [PATCH net-next v6 07/13] octeontx2-af: npc: cn20k: Prepare for new SoC Ratheesh Kannoth
2026-01-28  7:12 ` [PATCH net-next v6 08/13] octeontx2-af: npc: cn20k: Add new mailboxes for CN20K silicon Ratheesh Kannoth
2026-01-29  5:13   ` [net-next,v6,08/13] " Jakub Kicinski
2026-01-28  7:12 ` [PATCH net-next v6 09/13] octeontx2-af: npc: cn20k: virtual index support Ratheesh Kannoth
2026-01-29  5:13   ` [net-next,v6,09/13] " Jakub Kicinski
2026-01-28  7:12 ` [PATCH net-next v6 10/13] octeontx2-af: npc: cn20k: Allocate MCAM entry for flow installation Ratheesh Kannoth
2026-01-29  5:13   ` [net-next,v6,10/13] " Jakub Kicinski
2026-01-28  7:12 ` [PATCH net-next v6 11/13] octeontx2-pf: cn20k: Add TC rules support Ratheesh Kannoth
2026-01-29  5:13   ` [net-next,v6,11/13] " Jakub Kicinski
2026-01-28  7:12 ` [PATCH net-next v6 12/13] octeontx2-af: npc: cn20k: add debugfs support Ratheesh Kannoth
2026-01-28  7:12 ` [PATCH net-next v6 13/13] octeontx2-af: npc: Use common structures Ratheesh Kannoth

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=20260129155010.64297c67@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rkannoth@marvell.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=sumang@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