Article View: linux.kernel.netdev
Article #15934Re: [PATCH net-next 13/14] netfilter: conntrack: annotate data-races around timeout and tcp sysctls
From: Simon Horman
Date: Fri, 13 Nov 2026 17:19
Date: Fri, 13 Nov 2026 17:19
43 lines
10267 bytes
10267 bytes
On Mon, Nov 09, 2026 at 10:52:12AM +0800, Jiayuan Chen wrote:
> The nf_conntrack_*_timeout* knobs, nf_flowtable_tcp_timeout,
> nf_flowtable_udp_timeout and nf_conntrack_tcp_{loose,be_liberal,
> max_retrans,ignore_invalid_rst} are read in the packet path without any
> lock while their sysctl handlers update them with WRITE_ONCE(). Add
> READ_ONCE() to the readers.
>
> KCSAN reports it when nf_conntrack_udp_timeout is changed while UDP
> traffic goes through conntrack:
>
> BUG: KCSAN: data-race in nf_conntrack_udp_packet / proc_int_u2k_conv_uop
>
> write (marked) to 0xffffffffb0829bc4 of 4 bytes by task 436 on cpu 0:
> proc_int_u2k_conv_uop+0x92/0xa0
> sysctl_u2k_int_conv_hz+0x21/0x30
> proc_int_conv+0xdf/0x130
> do_proc_int_conv_jiffies+0x1b/0x30
> proc_vec_conv+0x21/0x40
> proc_vec+0x21e/0x6f0
> proc_dointvec_conv+0x21/0x40
> proc_dointvec_jiffies+0x15/0x30
> proc_sys_call_handler+0x282/0x3a0
> proc_sys_write+0x13/0x20
> ...
>
> read to 0xffffffffb0829bc4 of 4 bytes by task 439 on cpu 3:
> nf_conntrack_udp_packet+0x27b/0x550
> nf_conntrack_in+0x767/0xb20
> ipv4_conntrack_local+0xb0/0x120
> nf_hook_slow+0x7e/0x180
> nf_hook+0x1fa/0x4e0
> __ip_local_out+0x1ac/0x3f0
> ip_send_skb+0x31/0x120
> udp_send_skb+0x4bf/0x640
> udp_sendmsg+0xdec/0x18a0
> ...
>
> value changed: 0x00001d4c -> 0x00001e46
>
> Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID:
<20261113171957.GV18859@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362809-linux-kernel-netdev=dewy.ruReferences:
<20261109025425.328445-1-jiayuan.chen@linux.dev> <20261109025425.328445-14-jiayuan.chen@linux.dev>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362809-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 13/14] netfilter: conntrack: annotate data-races around timeout and tcp sysctls Date: Fri, 13 Nov 2026 17:19:57 +0000 Organization: Usenet Network Message-ID: <20261113171957.GV18859@horms.kernel.org> References: <20261109025425.328445-1-jiayuan.chen@linux.dev> <20261109025425.328445-14-jiayuan.chen@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1422070"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:iVlat1r1LFn20h5MqbpNvOponBI= sha256:yhYBaNHVSWwADQva67ylxNG4NHciAhXtwHB2KG3BL2o= sha1:cZXdzcG+FIjeR+Up8eIdnqK5cPI= sha256:+1IUJdcDQJFoJuD5JGALablhvS9McxjSiHxdcWunGlE= Content-Disposition: inline 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 AF40A11462F; Fri, 13 Nov 2026 22:44:19 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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=kernel.org 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 c4uTHDEJu-VU; Fri, 13 Nov 2026 22:44:16 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-362809-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 96CF1114624; Fri, 13 Nov 2026 22:44:08 +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 0C90724AAD1; Fri, 13 Nov 2026 17:29:05 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794590407; b=pVbYguj0Pvwm7b5/yWEoMKoBVpaJT3/CA0qyc1u44B2+Fpdknv7U0ok++eLs3rPdnxwk ESvHOcAb942jPQCidhVS/GswL1MGsGsFcAdbP9QPV4y8nEszt9Nx6AseYACes3Bb/lrDs y2RjUncLkB0kBzsVOXGGXsaIeCXD6gJfLjYNMMV9f8Gr+JlOPtEwScGW3NhXO8gwRWKL5 YLkcB3epODD+5QN3Xze0iDIwevQ4ck3WLfoHcmx+fU8q9C4CqpjMksfnhGM4TOsm2mBjM EYAS2N8CPDmkRXJrPwXK9eJAndN4sPR3mdSNmmvzZNbZLtuXdj3M0MK5r+qtCgr69VA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794590407; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=pLe6c2LhWdg08aU3SLTnHU4DwBkAqigblBo0XXQ9BX0=; b=PXd0rhFCoyTgBh5AGIAKw+Zr5GzMn18hfG9ivNb0UbHXpLCuXxuKdVcFkYftfiJ1BdKf YdJSBJgEJ3+GBUWeyXx9EQXMhRwtJzfjRjXi98bTQrhsvN8ondbjO1pgWaYLdBpe0ELzJ dGRQYvGjgdIQCWs7r/fMXAzZ7PGHcmfAiq3Pyd+EZ8V2hMqpuF85QBNhk1SPNXXrRqJHi 468hgsdLqvGuMUuAFbV2PSkW+xxyTz063mMoP4bH1YanCTZ57DGeQInaQs0742ZL+FGgj MzJsivI/9oDTAdeMeYmOPyCeKyPCtrqukJ51G+CFeaFP/Ftj9MgGBz7cIT1nLOtY7aQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gYBGfrXt; arc=pass header.oldest-pass=0 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 49078606F703; Fri, 13 Nov 2026 17:20:07 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gYBGfrXt X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794590406; b=4FwVqxc53Vbd/1XiAdVJmFWsCsf5Wg35doxOqyWQocaXFWaB9394SmwiQ2y6PJEiqb+8 NN8b0XL+HcwwVOSPa0h8ocYV5aDt7AlOFAFiKnKR13d8ByMzIC5hfwLKzLcmd7RtMI6Fi YOJMG9sX1J2xQKnUT/bcswibu133tEMweWKIoz20RLxoafzW9sQDvOYIfr7SL+vw7eTta c0USdH+96d2JNUF6E+YU/HjbrLdtxspN8m4TKj3cua/resLKiiLxZQxeLxfE/p1SkZQK4 U5QtPd8qqs20Dm5oehz9ouiZ0PTMnxXFosJVT9wsdxhvp7N3mg3GeOtb8E7bJeUZPFw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794590406; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=pLe6c2LhWdg08aU3SLTnHU4DwBkAqigblBo0XXQ9BX0=; b=KApGcv9qsVC0ER7M0aBItfkgSix4Z6zeKOntRu6dqsRQwDV1J46pD89xsxYU2ZkDQz8v RTdSn0kFZt0WogU0v/L4DXLiqUfR+hZgrWE/vH51fqlH058bupRuPuDKqw/jzWEi0TRIC sNQ+1GmgOyyEOssh53DoKGGmQzlnMhROmCKrWPo5LpOXoE5teJyEDNonH0nt3YBdrr/2y KYNOvoDq9yMqBpoLvtfSlYv1wrlVax8z8k72pPLJyWzXhAx/YJzjQiMmM2G4HpyR2YMrF 9EXjfct49Ae6BhP6OJ2rUJ4b+6gGwQlbqaeYLvbnl3RoUkIM5fJbkUuFlWhSjyal1dg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gYBGfrXt; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FB58606B462; Fri, 13 Nov 2026 17:20:06 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E21151F000C6; Fri, 13 Nov 2026 17:19:59 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794590406; bh=pLe6c2LhWdg08aU3SLTnHU4DwBkAqigblBo0XXQ9BX0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=gYBGfrXt2Ffp3CtT9lRu9Q4s81KSZzKqz9Lfo+PVwqO3aGrdqToyoAZeMLYx+juiA KtFrHhDOvqWjuv5gegWK1CFAegTV4RmiedbGywGgJfdkE+pu8ys3/EGxWW02qZWFpy HofAGIVx8fwFyNPwBLWF72gY4Vqk3SMEO1Pwq9eBSjoYvk8yZSUJKySbESzKGszr4o iCc/ryB4FO6VPjWC8EgEQeu7AWL8RDX4I+OW3weY7cfxZZCq9A8Z3l+mJkz84ZgeQI 44bi4zPENd8IWPJH6wv4vXH4sIppBMhelgZjQY5z49TqHo3iXU4rYX3ca2x1J5HiGC ZVsqI99IAXQAA== X-Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>, Ido Schimmel <idosch@nvidia.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Pablo Neira Ayuso <pablo@netfilter.org>, Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>, Nikolay Aleksandrov <razor@blackwall.org>, Paul Moore <paul@paul-moore.com>, Matthieu Baerts <matttbe@kernel.org>, Mat Martineau <martineau@kernel.org>, Geliang Tang <geliang@kernel.org>, Julian Anastasov <ja@ssi.bg>, Allison Henderson <achender@kernel.org>, Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>, Xin Long <lucien.xin@gmail.com>, "D. Wythe" <alibuda@linux.alibaba.com>, Dust Li <dust.li@linux.alibaba.com>, Sidraya Jayagond <sidraya@linux.ibm.com>, Mahanta Jambigi <mjambigi@linux.ibm.com>, Tony Lu <tonylu@linux.alibaba.com>, Wen Gu <guwen@linux.alibaba.com>, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, bridge@lists.linux.dev, linux-security-module@vger.kernel.org, mptcp@lists.linux.dev, lvs-devel@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-sctp@vger.kernel.org, linux-s390@vger.kernel.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 X-In-Reply-To: <20261109025425.328445-14-jiayuan.chen@linux.dev>