diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2024-01-23 09:08:52 -0800 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2024-03-26 18:22:35 -0400 |
commit | 0c41412330b8804ec9829ecb929a21d8cc2e06c5 (patch) | |
tree | 8c9aa82c8040bff1fadc9f8c2b35dbfd0bff4836 | |
parent | cffd4a7c975848e2bb7c577e5c814a0d2bc9efd4 (diff) | |
download | linux-stable-0c41412330b8804ec9829ecb929a21d8cc2e06c5.tar.gz linux-stable-0c41412330b8804ec9829ecb929a21d8cc2e06c5.tar.bz2 linux-stable-0c41412330b8804ec9829ecb929a21d8cc2e06c5.zip |
af_unix: Annotate data-race of gc_in_progress in wait_for_unix_gc().
[ Upstream commit 31e03207119a535d0b0e3b3a7f91983aeb2cb14d ]
gc_in_progress is changed under spin_lock(&unix_gc_lock),
but wait_for_unix_gc() reads it locklessly.
Let's use READ_ONCE().
Fixes: 5f23b734963e ("net: Fix soft lockups/OOM issues w/ unix garbage collector")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20240123170856.41348-2-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | net/unix/garbage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/unix/garbage.c b/net/unix/garbage.c index 4d283e26d816..0a212422b513 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c @@ -203,7 +203,7 @@ void wait_for_unix_gc(void) if (READ_ONCE(unix_tot_inflight) > UNIX_INFLIGHT_TRIGGER_GC && !READ_ONCE(gc_in_progress)) unix_gc(); - wait_event(unix_gc_wait, gc_in_progress == false); + wait_event(unix_gc_wait, !READ_ONCE(gc_in_progress)); } /* The external entry point: unix_gc() */ |