• Bart Van Assche's avatar
    RDMA/rxe: Fix a race condition in rxe_requester() · 65567e41
    Bart Van Assche authored
    The rxe driver works as follows:
    * The send queue, receive queue and completion queues are implemented as
      circular buffers.
    * ib_post_send() and ib_post_recv() calls are serialized through a spinlock.
    * Removing elements from various queues happens from tasklet
      context. Tasklets are guaranteed to run on at most one CPU. This serializes
      access to these queues. See also rxe_completer(), rxe_requester() and
      rxe_responder().
    * rxe_completer() processes the skbs queued onto qp->resp_pkts.
    * rxe_requester() handles the send queue (qp->sq.queue).
    * rxe_responder() processes the skbs queued onto qp->req_pkts.
    
    Since rxe_drain_req_pkts() processes qp->req_pkts, calling
    rxe_drain_req_pkts() from rxe_requester() is racy. Hence this patch.
    Reported-by: default avatarMoni Shoua <monis@mellanox.com>
    Signed-off-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    65567e41
rxe_req.c 18.7 KB