]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Merge branch 'tcp-take-care-of-tcp_get_timestamping_opt_stats-races'
authorJakub Kicinski <kuba@kernel.org>
Sat, 18 Apr 2026 18:10:15 +0000 (11:10 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 18 Apr 2026 18:10:16 +0000 (11:10 -0700)
Eric Dumazet says:

====================
tcp: take care of tcp_get_timestamping_opt_stats() races

tcp_get_timestamping_opt_stats() does not own the socket lock,
this is intentional.

It calls tcp_get_info_chrono_stats() while other threads could
change chrono fields in tcp_chrono_set(). It also reads many
tcp socket fields that can be modified by other cpus/threads.

I do not think we need coherent TCP socket state snapshot
in tcp_get_timestamping_opt_stats().

Add READ_ONCE()/WRITE_ONCE() or data_race() annotations.

Note that icsk_ca_state is a bitfield, thus not covered
in this series.
====================

Link: https://patch.msgid.link/20260416200319.3608680-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Trivial merge