From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 427FC346E7F; Tue, 31 Mar 2026 16:49:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774975759; cv=none; b=qaEdbHxuy3VH2IoU2DZcuVE2BPilNdUs8AvVOZa7+dtNOWuwClaS1n4wPq0EcebzIYQi4H2/TBBQAfGFLjiViJeE+VGguI3E6kDGxLAGyhxCqOpKT1YGmJuk3lU2bpzA7QWM4tSTDH7si5+bPszJvIsxlw1OiV5zPNgnB8P/Lno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774975759; c=relaxed/simple; bh=GzryvH572sUmUa8UsV0yBdDNSNvqeO7OopEd9MEeCII=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=knQGGP4fLLA4oFZvmoUF7ISOGwnoHJZTHjbnOpQ3kSNjOrtOgk1yZZiC7OC3X9I7KmJJ7QzmNtXGXo1duCSb6eyhKAV3hvLQ6rhAqTzgfuxbOQufQZBWNOzWepGLQ2J8EodkWUHLzMjpvKuyR8wRZcGyoWqpLG64VDXuFAd17tI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rKxJeflT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rKxJeflT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD80AC19423; Tue, 31 Mar 2026 16:49:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774975759; bh=GzryvH572sUmUa8UsV0yBdDNSNvqeO7OopEd9MEeCII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rKxJeflT2MavhdtjWu8iZuT6FLsgKR0Egrn3Tnva07dUUS25wDHGON9mAdjZRKtY0 6Gq8Jq6HAVXspR6GForOtISxCOTsloTjnTD1fYHyTde3PtAULmPYD/kxNuoDJ1yV4R e9S3Qil2ZGXXmuDybfyPko5jlkZNNEaULCsaI2Wo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yifan Wu , Juefei Pu , Ao Zhou , Yuan Tan , Xin Liu , Ilya Maximets , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 068/244] openvswitch: defer tunnel netdev_put to RCU release Date: Tue, 31 Mar 2026 18:20:18 +0200 Message-ID: <20260331161744.199316403@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260331161741.651718120@linuxfoundation.org> References: <20260331161741.651718120@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yang Yang [ Upstream commit 6931d21f87bc6d657f145798fad0bf077b82486c ] ovs_netdev_tunnel_destroy() may run after NETDEV_UNREGISTER already detached the device. Dropping the netdev reference in destroy can race with concurrent readers that still observe vport->dev. Do not release vport->dev in ovs_netdev_tunnel_destroy(). Instead, let vport_netdev_free() drop the reference from the RCU callback, matching the non-tunnel destroy path and avoiding additional synchronization under RTNL. Fixes: a9020fde67a6 ("openvswitch: Move tunnel destroy function to oppenvswitch module.") Reported-by: Yifan Wu Reported-by: Juefei Pu Tested-by: Ao Zhou Co-developed-by: Yuan Tan Signed-off-by: Yuan Tan Suggested-by: Xin Liu Signed-off-by: Yang Yang Reviewed-by: Ilya Maximets Link: https://patch.msgid.link/20260319074241.3405262-1-n05ec@lzu.edu.cn Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/openvswitch/vport-netdev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c index c688dee96503f..12055af832dc0 100644 --- a/net/openvswitch/vport-netdev.c +++ b/net/openvswitch/vport-netdev.c @@ -196,8 +196,6 @@ void ovs_netdev_tunnel_destroy(struct vport *vport) */ if (vport->dev->reg_state == NETREG_REGISTERED) rtnl_delete_link(vport->dev, 0, NULL); - netdev_put(vport->dev, &vport->dev_tracker); - vport->dev = NULL; rtnl_unlock(); call_rcu(&vport->rcu, vport_netdev_free); -- 2.51.0