* [PATCH net-next] tcp: annotate data-race around queue->synflood_warned
@ 2022-11-15 9:18 Eric Dumazet
2022-11-16 13:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2022-11-15 9:18 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: netdev, eric.dumazet, Eric Dumazet
Annotate the lockless read of queue->synflood_warned.
Following xchg() has the needed data-race resolution.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/ipv4/tcp_input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 94024fdc2da1b28af1b3b6e50735bf6b915f861d..0ae291e53eab228ce171cd73abafc009d99b886d 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6841,7 +6841,7 @@ static bool tcp_syn_flood_action(const struct sock *sk, const char *proto)
#endif
__NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPREQQFULLDROP);
- if (!queue->synflood_warned && syncookies != 2 &&
+ if (!READ_ONCE(queue->synflood_warned) && syncookies != 2 &&
xchg(&queue->synflood_warned, 1) == 0) {
if (IS_ENABLED(CONFIG_IPV6) && sk->sk_family == AF_INET6) {
net_info_ratelimited("%s: Possible SYN flooding on port [%pI6c]:%u. %s.\n",
--
2.38.1.431.g37b22c650d-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] tcp: annotate data-race around queue->synflood_warned
2022-11-15 9:18 [PATCH net-next] tcp: annotate data-race around queue->synflood_warned Eric Dumazet
@ 2022-11-16 13:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-16 13:40 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, kuba, pabeni, netdev, eric.dumazet
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Tue, 15 Nov 2022 09:18:51 +0000 you wrote:
> Annotate the lockless read of queue->synflood_warned.
>
> Following xchg() has the needed data-race resolution.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> net/ipv4/tcp_input.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [net-next] tcp: annotate data-race around queue->synflood_warned
https://git.kernel.org/netdev/net-next/c/bf36267e3ad3
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-16 13:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15 9:18 [PATCH net-next] tcp: annotate data-race around queue->synflood_warned Eric Dumazet
2022-11-16 13:40 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.