Skip to content

Commit 0490509

Browse files
borkmannmehmetb0
authored andcommitted
tcp: Annotate data-race around sk->sk_mark in tcp_v4_send_reset
BugLink: https://bugs.launchpad.net/bugs/2106770 [ Upstream commit 80fb40b ] This is a follow-up to 3c5b4d6 ("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: 3c5b4d6 ("net: annotate data-races around sk->sk_mark") Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/f459d1fc44f205e13f6d8bdca2c8bfb9902ffac9.1736244569.git.daniel@iogearbox.net Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Mehmet Basaran <[email protected]>
1 parent 12aa4ee commit 0490509

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_ipv4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb)
890890
sock_net_set(ctl_sk, net);
891891
if (sk) {
892892
ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ?
893-
inet_twsk(sk)->tw_mark : sk->sk_mark;
893+
inet_twsk(sk)->tw_mark : READ_ONCE(sk->sk_mark);
894894
ctl_sk->sk_priority = (sk->sk_state == TCP_TIME_WAIT) ?
895895
inet_twsk(sk)->tw_priority : READ_ONCE(sk->sk_priority);
896896
transmit_time = tcp_transmit_time(sk);

0 commit comments

Comments
 (0)