Netdev List
 help / color / mirror / Atom feed
From: Ratheesh Kannoth <rkannoth@marvell.com>
To: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
Cc: Sunil Goutham <sgoutham@marvell.com>,
	Geetha sowjanya <gakula@marvell.com>,
	Subbaraya Sundeep <sbhatta@marvell.com>,
	Bharat Bhushan <bbhushan2@marvell.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] octeontx2-pf: Fix potential use-after-free in representor teardown
Date: Tue, 17 Nov 2026 14:07:16 +0530	[thread overview]
Message-ID: <avwSPI9boSsUEtCr@rkannoth-OptiPlex-7090> (raw)
In-Reply-To: <20261116-c29ba55625-net-otx2-representor@mail.sdu.edu.cn>

On 2026-11-16 at 19:42:10, Guangshuo Li (liguangshuo@mail.sdu.edu.cn) wrote:
> The representor private data resides in its netdev allocation.
> rvu_rep_destroy() frees that allocation before reading rep->flow_cfg to
> release the flow configuration.
>
> Release the configuration while the representor is still alive.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support")
> Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
> ---
>  drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> index 0f5d5642d3f7..662da7fc3953 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> @@ -638,8 +638,8 @@ void rvu_rep_destroy(struct otx2_nic *priv)
>  		rep = priv->reps[rep_id];
>  		unregister_netdev(rep->netdev);
>  		rvu_rep_devlink_port_unregister(rep);
> -		free_netdev(rep->netdev);
>  		kfree(rep->flow_cfg);
> +		free_netdev(rep->netdev);
>  	}
>  	kfree(priv->reps);
>  	rvu_rep_rsrc_free(priv);
>
> base-commit: 2e54b3e187300893688c2c7517894f5d96732e05

Reviewed-by: Ratheesh Kannoth <rkannoth@marvell.com>

      parent reply	other threads:[~2026-11-17  8:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 14:12 [PATCH net] octeontx2-pf: Fix potential use-after-free in representor teardown Guangshuo Li
2026-11-16 14:18 ` netdev-bot+sinfo
2026-11-17  8:37 ` Ratheesh Kannoth [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=avwSPI9boSsUEtCr@rkannoth-OptiPlex-7090 \
    --to=rkannoth@marvell.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bbhushan2@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gakula@marvell.com \
    --cc=kuba@kernel.org \
    --cc=liguangshuo@mail.sdu.edu.cn \
    --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