]> git.baikalelectronics.ru Git - kernel.git/commit
IB/core: Add lock to multicast handlers
authorMatan Barak <matanb@mellanox.com>
Tue, 4 Apr 2017 10:31:45 +0000 (13:31 +0300)
committerDoug Ledford <dledford@redhat.com>
Wed, 5 Apr 2017 17:28:04 +0000 (13:28 -0400)
commit9755b79e6193bd53e01377c0e8dc31fb210a64c1
tree473fc982c9709d5cea848b37544471ece8c315b1
parent96cbb5786e3a3da10c5073de468450cb7b9427c9
IB/core: Add lock to multicast handlers

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: Matan Barak <matanb@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs.h
drivers/infiniband/core/uverbs_cmd.c