]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r336365:
authorhselasky <hselasky@FreeBSD.org>
Thu, 2 Aug 2018 08:07:10 +0000 (08:07 +0000)
committerhselasky <hselasky@FreeBSD.org>
Thu, 2 Aug 2018 08:07:10 +0000 (08:07 +0000)
commit8fd671147ab38b886bee91fa1e1bde35a8c77e5a
tree7a5b3be5bb5ea5a5bcc7d25266ec18f20a1f08a2
parent92e2e733ee00890f9ef4a735fe6dc25ad8265603
MFC r336365:
Add lock to multicast handlers in ibcore.

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.

Linux commit:
f48b726920d96dcd1860df06143bdea7d6d7dcc3

Sponsored by: Mellanox Technologies
sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c
sys/ofed/drivers/infiniband/core/uverbs.h