diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2022-08-10 16:00:42 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-25 12:15:34 +0300 |
commit | 9c08d253d3fc67b988024d8e3dec30c1ec993d5d (patch) | |
tree | 74c34ba3ab337574c9632868285a40ece420f629 /net | |
parent | 69b1872b6da25d501011d868f2bc9c4e03fe8fa7 (diff) | |
download | linux-9c08d253d3fc67b988024d8e3dec30c1ec993d5d.tar.xz |
rds: add missing barrier to release_refill
commit 9f414eb409daf4f778f011cf8266d36896bb930b upstream.
The functions clear_bit and set_bit do not imply a memory barrier, thus it
may be possible that the waitqueue_active function (which does not take
any locks) is moved before clear_bit and it could miss a wakeup event.
Fix this bug by adding a memory barrier after clear_bit.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/rds/ib_recv.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index 2f16146e4ec9..18e0e3cba1ac 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c @@ -362,6 +362,7 @@ static int acquire_refill(struct rds_connection *conn) static void release_refill(struct rds_connection *conn) { clear_bit(RDS_RECV_REFILL, &conn->c_flags); + smp_mb__after_atomic(); /* We don't use wait_on_bit()/wake_up_bit() because our waking is in a * hot path and finding waiters is very rare. We don't want to walk |