projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac52864
)
tcp: annotate data-races around tp->tcp_tx_delay
author
Eric Dumazet
<edumazet@google.com>
Wed, 19 Jul 2023 21:28:47 +0000
(21:28 +0000)
committer
Jakub Kicinski
<kuba@kernel.org>
Thu, 20 Jul 2023 19:34:17 +0000
(12:34 -0700)
do_tcp_getsockopt() reads tp->tcp_tx_delay while another cpu
might change its value.
Fixes: a842fe1425cb ("tcp: add optional per socket transmit delay")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link:
https://lore.kernel.org/r/20230719212857.3943972-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp.c
patch
|
blob
|
history
diff --git
a/net/ipv4/tcp.c
b/net/ipv4/tcp.c
index e03e08745308189c9d64509c2cff94da56c86a0c..bd6400e1ae9f8ae595bbe759ff3dfb1bd02765e2 100644
(file)
--- a/
net/ipv4/tcp.c
+++ b/
net/ipv4/tcp.c
@@
-3674,7
+3674,7
@@
int do_tcp_setsockopt(struct sock *sk, int level, int optname,
case TCP_TX_DELAY:
if (val)
tcp_enable_tx_delay();
-
tp->tcp_tx_delay = val
;
+
WRITE_ONCE(tp->tcp_tx_delay, val)
;
break;
default:
err = -ENOPROTOOPT;
@@
-4154,7
+4154,7
@@
int do_tcp_getsockopt(struct sock *sk, int level,
break;
case TCP_TX_DELAY:
- val =
tp->tcp_tx_delay
;
+ val =
READ_ONCE(tp->tcp_tx_delay)
;
break;
case TCP_TIMESTAMP: