summaryrefslogtreecommitdiff
path: root/net/sctp
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-08-18 04:51:32 +0300
committerJakub Kicinski <kuba@kernel.org>2023-08-19 05:23:30 +0300
commit76f33296d2e09f63118db78125c95ef56df438e9 (patch)
treefcdfc4cd47f9c05965ba57866a29c55d269ed3e4 /net/sctp
parentd44036cad31170da0cb9c728e80743f84267da6e (diff)
downloadlinux-76f33296d2e09f63118db78125c95ef56df438e9.tar.xz
sock: annotate data-races around prot->memory_pressure
*prot->memory_pressure is read/writen locklessly, we need to add proper annotations. A recent commit added a new race, it is time to audit all accesses. Fixes: 2d0c88e84e48 ("sock: Fix misuse of sk_under_memory_pressure()") Fixes: 4d93df0abd50 ("[SCTP]: Rewrite of sctp buffer management code") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Abel Wu <wuyun.abel@bytedance.com> Reviewed-by: Shakeel Butt <shakeelb@google.com> Link: https://lore.kernel.org/r/20230818015132.2699348-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 9388d98aebc0..6da738f60f4b 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -99,7 +99,7 @@ struct percpu_counter sctp_sockets_allocated;
static void sctp_enter_memory_pressure(struct sock *sk)
{
- sctp_memory_pressure = 1;
+ WRITE_ONCE(sctp_memory_pressure, 1);
}