aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/ipv4/tcp_minisocks.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-21 20:28:11 +0000
committerDavid S. Miller <davem@davemloft.net>2023-10-01 19:09:54 +0100
commit10bbf1652c1cca9819e98d56f3432c56d7a2d229 (patch)
treeab9494c905436ea6f2b9fa1bb979addd2d58da71 /net/ipv4/tcp_minisocks.c
parentopenvswitch: reduce stack usage in do_execute_actions (diff)
downloadwireguard-linux-10bbf1652c1cca9819e98d56f3432c56d7a2d229.tar.xz
wireguard-linux-10bbf1652c1cca9819e98d56f3432c56d7a2d229.zip
net: implement lockless SO_PRIORITY
This is a followup of 8bf43be799d4 ("net: annotate data-races around sk->sk_priority"). sk->sk_priority can be read and written without holding the socket lock. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_minisocks.c')
-rw-r--r--net/ipv4/tcp_minisocks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index eee8ab1bfa0e..3f87611077ef 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -292,7 +292,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
tw->tw_transparent = inet_test_bit(TRANSPARENT, sk);
tw->tw_mark = sk->sk_mark;
- tw->tw_priority = sk->sk_priority;
+ tw->tw_priority = READ_ONCE(sk->sk_priority);
tw->tw_rcv_wscale = tp->rx_opt.rcv_wscale;
tcptw->tw_rcv_nxt = tp->rcv_nxt;
tcptw->tw_snd_nxt = tp->snd_nxt;