From: Simon Horman <horms@kernel.org>
To: sbhatta@marvell.com
Cc: 'Simon Horman' <horms@kernel.org>,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, sgoutham@marvell.com,
gakula@marvell.com, bbhushan2@marvell.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] octeontx2-af: mcs: Fix unsupported secy stats read
Date: Wed, 3 Jun 2026 17:38:46 +0100 [thread overview]
Message-ID: <20260603163846.3824713-1-horms@kernel.org> (raw)
In-Reply-To: <1780054661-17194-1-git-send-email-sbhatta@marvell.com>
From: 'Simon Horman' <horms@kernel.org>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
Full review at: https://sashiko.dev
---
octeontx2-af: mcs: Fix unsupported secy stats read
This commit updates mcs_get_rx_secy_stats() to skip reading the Secy
control stats counter on CNF10KB platforms, since the register does
not exist.
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mcs.c b/drivers/net/ethernet/marvell/octeontx2/af/mcs.c
> index c1775bd01c2b4..a07e0b3d8d000 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/mcs.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/mcs.c
> @@ -120,13 +120,13 @@ void mcs_get_rx_secy_stats(struct mcs *mcs, struct mcs_secy_stats *stats, int id
> reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDX(id);
> stats->pkt_untaged_cnt = mcs_reg_read(mcs, reg);
>
> - reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYCTLX(id);
> - stats->pkt_ctl_cnt = mcs_reg_read(mcs, reg);
> -
> if (mcs->hw->mcs_blks > 1) {
> reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYNOTAGX(id);
> stats->pkt_notag_cnt = mcs_reg_read(mcs, reg);
> + return;
[Severity: Medium]
Will this early return cause an uninitialized memory leak in debugfs?
In rvu_debugfs.c, rvu_dbg_mcs_rx_secy_stats_display() allocates the stats
structure on the stack without zero-initializing it, and passes it to
mcs_get_rx_secy_stats() to be populated.
Since the early return now skips setting stats->pkt_ctl_cnt, and the caller
unconditionally prints it via seq_printf(), could this result in leaking
uninitialized stack memory to userspace when the debugfs file is read?
> }
> + reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYCTLX(id);
> + stats->pkt_ctl_cnt = mcs_reg_read(mcs, reg);
> }
prev parent reply other threads:[~2026-06-03 16:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 11:37 [PATCH net] octeontx2-af: mcs: Fix unsupported secy stats read Subbaraya Sundeep
2026-06-03 16:38 ` Simon Horman [this message]
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=20260603163846.3824713-1-horms@kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bbhushan2@marvell.com \
--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