* [PATCH linux] netfilter: conntrack: Add missing modification about data-race around ct->timeout
@ 2025-11-17 8:56 Chenguang Zhao
2025-11-17 11:02 ` Florian Westphal
0 siblings, 1 reply; 2+ messages in thread
From: Chenguang Zhao @ 2025-11-17 8:56 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
Phil Sutter, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman
Cc: Chenguang Zhao, netfilter-devel, coreteam, netdev, linux-kernel
Add missing modification about data-race around ct->timeout
Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Fixes: 802a7dc5cf1b ("netfilter: conntrack: annotate data-races around ct->timeout")
---
net/netfilter/nf_conntrack_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 344f88295976..0b26d53f3b65 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1297,7 +1297,7 @@ __nf_conntrack_confirm(struct sk_buff *skb)
/* Timeout is relative to confirmation time, not original
setting time, otherwise we'd get timer wrap in
weird delay cases. */
- ct->timeout += nfct_time_stamp;
+ WRITE_ONCE(ct->timeout, ct->timeout + nfct_time_stamp);
__nf_conntrack_insert_prepare(ct);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH linux] netfilter: conntrack: Add missing modification about data-race around ct->timeout
2025-11-17 8:56 [PATCH linux] netfilter: conntrack: Add missing modification about data-race around ct->timeout Chenguang Zhao
@ 2025-11-17 11:02 ` Florian Westphal
0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2025-11-17 11:02 UTC (permalink / raw)
To: Chenguang Zhao
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, Phil Sutter, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
netfilter-devel, coreteam, netdev, linux-kernel
Chenguang Zhao <zhaochenguang@kylinos.cn> wrote:
> Add missing modification about data-race around ct->timeout
This could use a bit more verbose explanation.
> weird delay cases. */
> - ct->timeout += nfct_time_stamp;
> + WRITE_ONCE(ct->timeout, ct->timeout + nfct_time_stamp);
~~~~~~~~~~~
Shouldn't that be
WRITE_ONCE(ct->timeout, READ_ONCE(ct->timeout) + nfct_time_stamp); ?
Furthermore, patch subject should list either [nf] or [nf-next] to
indicate the tree you want this patch applied to.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-17 11:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17 8:56 [PATCH linux] netfilter: conntrack: Add missing modification about data-race around ct->timeout Chenguang Zhao
2025-11-17 11:02 ` Florian Westphal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).