• Matan Barak's avatar
    IB/core: Add lock to multicast handlers · f48b7269
    Matan Barak authored
    When two handlers used the same object in the old schema, we blocked
    the process in the kernel. The new schema just returns -EBUSY. This
    could lead to different behaviour in applications between the old
    schema and the new schema. In most cases, using such handlers
    concurrently could lead to crashing the process. For example, if
    thread A destroys a QP and thread B modifies it, we could have the
    destruction happens before the modification. In this case, we are
    accessing freed memory which could lead to crashing the process.
    This is true for most cases. However, attaching and detaching
    a multicast address from QP concurrently is safe. Therefore, we
    preserve the original behaviour by adding a lock there.
    Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
    Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    f48b7269
uverbs_cmd.c 93.8 KB