Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tcp: Annotate data-race around sk->sk_mark in tcp_v4_send_reset

This is a follow-up to 3c5b4d69c358 ("net: annotate data-races around
sk->sk_mark"). sk->sk_mark can be read and written without holding
the socket lock. IPv6 equivalent is already covered with READ_ONCE()
annotation in tcp_v6_send_response().

Fixes: 3c5b4d69c358 ("net: annotate data-races around sk->sk_mark")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/f459d1fc44f205e13f6d8bdca2c8bfb9902ffac9.1736244569.git.daniel@iogearbox.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Daniel Borkmann and committed by
Jakub Kicinski
80fb40ba d1cacd74

+1 -1
+1 -1
net/ipv4/tcp_ipv4.c
··· 896 896 sock_net_set(ctl_sk, net); 897 897 if (sk) { 898 898 ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ? 899 - inet_twsk(sk)->tw_mark : sk->sk_mark; 899 + inet_twsk(sk)->tw_mark : READ_ONCE(sk->sk_mark); 900 900 ctl_sk->sk_priority = (sk->sk_state == TCP_TIME_WAIT) ? 901 901 inet_twsk(sk)->tw_priority : READ_ONCE(sk->sk_priority); 902 902 transmit_time = tcp_transmit_time(sk);