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 57A264F4049; Tue, 13 Oct 2026 12:03:52 +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=1791893033; cv=none; b=liLye0w+q2Bjkk8qD7Wv2ZXrM11ZO0yDBDgQ6PI9DcUvAPVB8tRECfEOhbqefWlLehx+FEQ7FowtslrpjiasRWKzmEf9vD/vVRcqBQPfDFWrAuTroPBHvIE38cU9ZM1+Ys/3zO2AHQSzvw2H5pUD8hVJJT9wpvLVn0XZ+FkNgTs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791893033; c=relaxed/simple; bh=hipbkjyAjVBPZJCnnlkwkWQh3YvJpI92NL3OZ4tRDaQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IQttyeD2K5cGPLF9dD26Tqo0KUy3ccKkU5LOGHu285QzYUEdc1ceYInoD1KnjmF+DSE6M2zQAE7Xud98Q7l5AAtDrjnDJTTPTbg3pyx9HY/PrH1mOb5ZLV6iUb7fVmAkxOkg8seDOCHGTVMtmWe/NXqX5RcMzyHX7Dwitqzbpj4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mT21fSf7; 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="mT21fSf7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A56411F000FF; Tue, 13 Oct 2026 12:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791893032; bh=BO5RkPihih4IbeRCLmALkQijwWXr3jv6aNA31hRd5vU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mT21fSf7y6mIcPG6QN0rqM8Wcb39VZzjiAS4O179frMhx8k64VNz3yuB+hdtKWIMU clCIg+oRAXhRQk4fZcixEeAEW+psIsF0ujly+6WxmGn31Lw/iyMPcl5k4L4DuVu6S0 H3tjlJhdbd8JCTtpmE+GeI2PKgQv+S62nnqTF1DM= 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 6.18 063/621] ice: fix metadata_dst refcount handling on representor teardown Date: Tue, 13 Oct 2026 13:30:58 +0200 Message-ID: <20261013112922.356606616@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112920.855194808@linuxfoundation.org> References: <20261013112920.855194808@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 6.18-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);