Article View: linux.kernel.netdev
Article #26506[PATCH net] net: openvswitch: read the ct timeout policy with rcu_access_pointer()
From: Kyuwon Cho
Date: Thu, 03 Dec 2026 16:37
Date: Thu, 03 Dec 2026 16:37
50 lines
11929 bytes
11929 bytes
ovs_ct_copy_action() keeps the timeout policy of the action's conntrack
template only so that skb_nfct_cached() can compare it with the policy
of a later connection; the pointer is never dereferenced through this
copy. It is read with rcu_dereference() outside an RCU read-side
critical section, so adding a ct action with a timeout policy makes
lockdep complain:
WARNING: suspicious RCU usage
net/openvswitch/conntrack.c:1435 suspicious rcu_dereference_check() usage!
Call Trace:
ovs_ct_copy_action (net/openvswitch/conntrack.c:1435)
__ovs_nla_copy_actions (net/openvswitch/flow_netlink.c:3478)
ovs_nla_copy_actions (net/openvswitch/flow_netlink.c:3617)
ovs_flow_cmd_new (net/openvswitch/datapath.c:1058)
genl_family_rcv_msg_doit (net/netlink/genetlink.c:1114)
Read it with rcu_access_pointer().
Fixes: 7177895154e6 ("openvswitch: Fix conntrack cache with timeout")
Signed-off-by: Kyuwon Cho <kyuwon.cho@skku.edu>
---
The issue was found by an LLM-guided test generator that we are
developing as a research prototype. It reproduces with
CONFIG_PROVE_RCU as any user in its own user and network namespace: a
conntrack timeout policy created through nfnetlink_cttimeout, an OVS
datapath, and a flow whose ct action names that policy. With the patch
lockdep stays quiet.
Found and tested on mainline fe6ff8d5d675 (v7.4-rc5, with KASAN);
the patch is against net (76fca30e8d34).
net/openvswitch/conntrack.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index d3326edcabf7..fc0779e30be2 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -1432,7 +1432,7 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr,
"Failed to associated timeout policy '%s'",
ct_info.timeout);
else
- ct_info.nf_ct_timeout = rcu_dereference(
+ ct_info.nf_ct_timeout = rcu_access_pointer(
nf_ct_timeout_find(ct_info.ct)->timeout);
}
--
2.43.0
Technical Details
Message-ID:
<179607207065.562302.3053229720477342352@skku.edu>Path:
mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376760-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376760-linux-kernel-netdev=dewy.ru From: kyuwon.cho@skku.edu (Kyuwon Cho) Newsgroups: linux.kernel.netdev Subject: [PATCH net] net: openvswitch: read the ct timeout policy with rcu_access_pointer() Date: Fri, 4 Dec 2026 01:37:30 +0900 Organization: Usenet Network Message-ID: <179607207065.562302.3053229720477342352@skku.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2542588"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:jkwtQIFGgjB8TiPlz3PkMK76T+Y= sha256:bydlZY87SHJsUiNEGPskHlARp+Lrsi6uLNR74S9q1XM= sha1:NWIiGO0uW0MbFnDsbsx9bL/mglw= sha256:Ri7OLsI2DC5cYgDghthjO6VpX0WwDNi8FVAOvAoAnSw= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id A3FFA1179D6; Thu, 3 Dec 2026 19:38:03 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.299 X-Spam-Status: No, score=-3.299 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=worksmobile.com header.b=Yzq9IBBs; dkim=pass (2048-bit key) header.d=skku.edu header.b=qd306+Jm X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GiZt1emrPuAc; Thu, 3 Dec 2026 19:38:00 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376760-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=skku.edu X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 80ED21179D5; Thu, 3 Dec 2026 19:37:42 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id C950624422; Thu, 3 Dec 2026 16:37:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1796315860; b=sSeP+XgvpVR5YWsp6ewm42tboIwNlIpzoE4Xm1YTHY0vhAPL+DFyWs9oYLswCqHGYTWp rDVcFBGmf9oYq765EK0zX8Vsz5AbKMXTvhMg6clsnIyxpXycPcJBPDivlT9z+oZodSfff qr5jcIoz3hc82uF2VcF8juHBvdlLWl494p5c54n6rnpUcrSghlKBnsj/NCjcCOnJ3AjoR m057o9yioxNTfBAOWNuchTAkaSF6EOcMt4oBUBxgVNoCB5mU3u+mqh3osDsex9nr3WHYr aJbQzsqYL72KJ8NzJMohVAUL6trYHtOkJYcpy87TgYmpWKn/gFQnszNbq++MKXu4U+Q== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796315860; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received: DKIM-Signature:X-Session-ID:X-Works-Send-Opt:X-Works-Smtp-Source: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Transfer-Encoding; bh=C5o85Q+p02uLR3wlNt80ufzDMYUXtEqSFsrVewQqb4E=; b=elqgJnVNhI5AJyKvfja7O66eWpBesJhweuPYvRLlEZaRIpIRHLRcrUdS4IIPYD3WnEsr lG7hT0riiyXcXdzs1B7TPXMKnuBIw/ycLJfNVIUD7o2vE99wTcSp9a2dnVw5bmaPVo+mM pqpxbEd0jev/vPyvw4jrkfQNxFDhYRKCMQpTMArUa1GDrCYUy6g5ctjV4ecux7C3Xzu0K Dy1O1yA/9M6YSYwL/Fax+u0u0S6TV5csm+u07k2yTyZ9S8cLVYSH9xLDF9lRdM3y+c0vK R7YMVxPumDsF4ZJg6WRioCAVfCWgyRJvQAE61POrixOe+SonWZ/iEqcmT7PjK4ze0uA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=worksmobile.com header.i=@worksmobile.com header.a=rsa-sha256 header.s=s20171120 header.b=Yzq9IBBs; dkim=pass header.d=skku.edu header.i=@skku.edu header.a=rsa-sha256 header.s=naverworks header.b=qd306+Jm; dmarc=pass header.from=skku.edu; spf=pass smtp.mailfrom=skku.edu; arc=fail smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DAF8606A333; Thu, 3 Dec 2026 16:37:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=worksmobile.com header.i=@worksmobile.com header.a=rsa-sha256 header.s=s20171120 header.b=Yzq9IBBs; dkim=pass (2048-bit key) header.d=skku.edu header.i=@skku.edu header.a=rsa-sha256 header.s=naverworks header.b=qd306+Jm X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=125.209.209.79 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796315859; b=Rv+dAa5RCL5lZTnRf6ain3uKIRfpR2HEE1UfArMQlNnZYQVf0N3dpq5eQnoolw26Tf7D 3FhYrGlm7BoIJPftchyf9W7p6K3zXJgZvorUxO9ZXhzTukD70OJ8CdmkuWM2OMLxtsigA Rf8qbb3nb6OOYpUxY+FtD9Hr7gSsWQiW3Sc2YnjGDkh4M88AHkYz3qKWLlZ5X5FeoVvoy n8owDTxUUYgmogrAGmHodVaM/iRIl1w/aK1/iQAv4SVAGpyKbNymTghC/k5h+TpU8Gmdu EOt/l1iyCrxfXFH3A3lVIr2yxxFL+Cqhqlll82mgzZ1NV+8RxgWCq4MTRxanAknL2WQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796315859; h=DMARC-Filter:DKIM-Signature:X-Originating-IP:Received:DKIM-Signature: X-Session-ID:X-Originating-IP:X-Works-Send-Opt:X-Works-Smtp-Source: Received:From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding; bh=C5o85Q+p02uLR3wlNt80ufzDMYUXtEqSFsrVewQqb4E=; b=WTXjDUkpyjaWU3SJhZnq9V8khlhGTBz1G8Z83m9xcuXmuL9Nnqq9vzvx2jswUKZkJacs fkBkMsOfXL0wpaAU13C6AmnQqwo2Ab1UtS6m8XeJ4vl7lFrVPsGv0+9mxKfOb1quhbQop +mrlTt1PYgREyv3eFjbzkYuiy+2LsCxnjnWrczm4rcxfbpn00nlbpdLORVbcEm8bD2K6M FkQcV2EIDSYn2aFPBK5Ldkh0TUT22qU0xpTdji4pDVPWLQM+xWO6HdN3bW2bMemhFVq1+ 9MUcQlniuGTHXA5gSd+IE7y+ggjOjT8Dqbh6U33NhBKj090IH7lHSKkoJFCuYKWAtfg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=skku.edu; spf=pass smtp.mailfrom=skku.edu; dkim=pass header.d=worksmobile.com header.i=@worksmobile.com header.a=rsa-sha256 header.s=s20171120 header.b=Yzq9IBBs; dkim=pass header.d=skku.edu header.i=@skku.edu header.a=rsa-sha256 header.s=naverworks header.b=qd306+Jm; arc=none smtp.remote-ip=125.209.209.79 X-Received: from cvsmtppost106.wmail.worksmobile.com (cvsmtppost106.wmail.worksmobile.com [125.209.209.79]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A3D7606A32D for <netdev@vger.kernel.org>; Thu, 3 Dec 2026 16:37:38 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7A3D7606A32D X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=skku.edu X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=skku.edu X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=worksmobile.com; s=s20171120; t=1796315851; bh=fcdUU2CYpzOGCShGgEZVYFIAKFm8A43meVw3+dZaAvI=; h=From:To:Subject:Date:Message-ID:From:Subject:Feedback-ID: X-Works-Security; b=Yzq9IBBsz0Sw+K6BQqThr0ckYFELwZdgWF0Y05H0tNu47PmXOOaFI0rCOPh95Xw2c c9NdFhVhKK5bWQ+904nlrC9xgHVASYazmZqlYbYpy3KIYHO+4Z86LkWOZJaf8uFTf/ Pxw3XkpOnRHt0TmbD53ORTUG/arwBl9Hom78FlMI9fZYae4+xhG9QD09S3XINZgTua 8bWXsUSLDwbMxzftgODLckHFrDak+CaQUppvqSGSrZNcvbtJKzYWbCsUuIG3XwDFeU vzM0LVqge5u/KfxfT90W9gkVqQhyFsmYqUmUby6IO2dMj0z96KNIotPSzhLOo6rJZq PHVe8KED5waYQ== X-Received: from kr1-hmac-real-0 ([10.174.201.129]) by cvsmtppost106.wmail.worksmobile.com with ESMTP id fHMSTtXmSKimwQ9YhwJlZg for <netdev@vger.kernel.org>; Thu, 03 Dec 2026 16:37:31 -0000 X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=skku.edu; s=naverworks; t=1796315851; bh=fcdUU2CYpzOGCShGgEZVYFIAKFm8A43meVw3+dZaAvI=; h=From:To:Subject:Date:Message-ID:From:Subject:Feedback-ID: X-Works-Security; b=qd306+JmUDzL4dLQypn7xQTPcDzFFJM2/1CCwvKdKOVkpy9qLAbNIz/J5bJCiUekP 3qPdXbGAIezltKrD6FhiKtrYxK4ZE6cin8Wigjnvr/uuMJAaqwKLQjfAa4I4aWeGiT eybY7hcDi17TRAP1foZQBNAbw8sRS8Doi6QFUJWDwTaT2PxYD3O5aePXbV8tkuflxb 8hsmZ5Q8SMnGPDJiog/F+VS/z/1CEm8gpHV5LZWYqG0kOIVTpRGndjJjG8/SLct5Zg cJ0ombN7C7Aku1OeyoyGbfYgcUf9P1yN9AKY8hcngUF5FbG+/2Qys63WyzPExmmLQD lWJyermuYwQ6g== X-Session-ID: qi9Fo-E7RgCjlpHdyyHtqg X-Works-Send-Opt: wdbXFqgmKAKmKAFYKqMqKA2mFAurjAumKAgmKxEmKqK/aAtwaBmmjAuqjAuraAvqKAU/FokYjHmm X-Works-Smtp-Source: IZK/KoMlFqJZ+HmmFxtq+6E= X-Received: from d4082dd914b5.tail196be.ts.net ([115.145.173.180]) by cvnsmtp101.wmail.worksmobile.com with ESMTP id qi9Fo-E7RgCjlpHdyyHtqg for <multiple recipients> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 03 Dec 2026 16:37:30 -0000 X-Cc: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Willem de Bruijn <willemb@google.com>, Yi-Hung Wei <yihung.wei@gmail.com>, Pravin B Shelar <pshelar@ovn.org>, netdev@vger.kernel.org, dev@openvswitch.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list