Netdev List
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Tristan Madani <tristmd@gmail.com>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Grzegorz Nitka <grzegorz.nitka@intel.com>,
	Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	stable@vger.kernel.org,
	Tristan Madani <tristan@talencesecurity.com>
Subject: Re: [PATCH net] ice: fix metadata_dst refcount handling on representor teardown
Date: Wed, 19 Aug 2026 16:51:22 +0100	[thread overview]
Message-ID: <20260819155122.GU265046@horms.kernel.org> (raw)
In-Reply-To: <20260816135510.1015041-1-tristmd@gmail.com>

On Sun, Aug 16, 2026 at 01:55:10PM +0000, Tristan Madani wrote:
> From: Tristan Madani <tristan@talencesecurity.com>
> 
> ice_eswitch_release_repr() uses metadata_dst_free() to release the
> representor's metadata_dst.  metadata_dst_free() directly frees the
> underlying memory without checking the dst_entry refcount.
> 
> When ice_eswitch_port_start_xmit() processes a packet, it takes a
> reference via dst_hold() and attaches the metadata_dst to the skb.
> If the representor is torn down while packets are still queued on
> the lower device (e.g. in a qdisc), the metadata_dst is freed while
> references are still held.
> 
> Use dst_release() instead, which correctly decrements the refcount
> and only frees the object when all references are dropped.  The dst
> subsystem already handles metadata_dst cleanup in dst_destroy() when
> DST_METADATA is set.
> 
> Other drivers sharing this pattern (nfp, airoha, bnxt) already use
> dst_release() for their metadata_dst lifecycle.
> 
> Fixes: f5396b8a663f7 ("ice: switchdev slow path")
> Cc: stable@vger.kernel.org
> Signed-off-by: Tristan Madani <tristan@talencesecurity.com>

Reviewed-by: Simon Horman <horms@kernel.org>


      reply	other threads:[~2026-08-19 15:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-16 13:55 [PATCH net] ice: fix metadata_dst refcount handling on representor teardown Tristan Madani
2026-08-19 15:51 ` 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=20260819155122.GU265046@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=grzegorz.nitka@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tristan@talencesecurity.com \
    --cc=tristmd@gmail.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