lkml.org 
[lkml]   [2022]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 004/158] rds: add missing barrier to release_refill
    Date
    From: Mikulas Patocka <mpatocka@redhat.com>

    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>
    ---
    net/rds/ib_recv.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/net/rds/ib_recv.c
    +++ b/net/rds/ib_recv.c
    @@ -363,6 +363,7 @@ static int acquire_refill(struct rds_con
    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

    \
     
     \ /
      Last update: 2022-08-23 14:09    [W:4.053 / U:0.464 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site