From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B12E4DEC22; Tue, 13 Oct 2026 11:48:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791892113; cv=none; b=PdzWHcKwWEY36OWTEesu0hBKN1m+YXPLe1PqA5PadSRBqGQ3lAyh9IYa74wSek4PfOLduJnRNh/IB5n3PTkokQ+kovFAeyv8x4MRyDi/nSnrNghUFgiNGxCZ7lZJePmFkTD1EoFb3I6GSBQ42QtnWjRj/ieRMQIEHoWZ+r6vo/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791892113; c=relaxed/simple; bh=aG8xihrnx3f+ykUQTxFDt23rTOV3VXxtIRHW5JNKxzo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hgOdRJnLLdNWB/eXlypzRw1udO2076a0Zls4t42jm+m9QMVslmz+selyf6CTzT36mErIbGWimxWsmB9KJKle/hoVWMGOl9J+edulrxfhi5HinxaHPlKhTGHGKa7/l4IdoxTuZ9/XNcq/xaiogP+tnoxTQpvzDj/QWS2ElU5mVTk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BXuOUmYR; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BXuOUmYR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBADB1F000FF; Tue, 13 Oct 2026 11:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791892111; bh=Z1rTd1CRm0lCWDTBUbaL3eUg35bYfRhafKkwlpo4qZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BXuOUmYRylxcXImzExam97YyiFAnkTgifvMdNaRG74cTYNldbnFaZxqIARE+Tporj H9td6R6JiB1Apvdb0aFt+6lhVuPso3qpVEv3yrMwx1wZ6WGEMVd5eAZ0Bfd2FW858V O3/+FvHBPEoTc3Oaqg3UlnPhSgEE5jEKoc/hgbGg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tristan Madani , Simon Horman , Tony Nguyen , Jakub Kicinski Subject: [PATCH 7.2 063/281] ice: fix metadata_dst refcount handling on representor teardown Date: Tue, 13 Oct 2026 13:36:19 +0200 Message-ID: <20261013112856.657720186@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112855.045212108@linuxfoundation.org> References: <20261013112855.045212108@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tristan Madani commit 58858b8f14803a7eeac297b3ce20f3b21bf2ff66 upstream. 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 Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260928230429.495442-5-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ice/ice_eswitch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/intel/ice/ice_eswitch.c +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c @@ -95,7 +95,7 @@ ice_eswitch_release_repr(struct ice_pf * return; ice_vsi_update_security(vsi, ice_vsi_ctx_set_antispoof); - metadata_dst_free(repr->dst); + dst_release(&repr->dst->dst); repr->dst = NULL; ice_fltr_add_mac_and_broadcast(vsi, repr->parent_mac, ICE_FWD_TO_VSI);