]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add lock to multicast handlers in ibcore.
authorhselasky <hselasky@FreeBSD.org>
Tue, 17 Jul 2018 08:52:29 +0000 (08:52 +0000)
committerhselasky <hselasky@FreeBSD.org>
Tue, 17 Jul 2018 08:52:29 +0000 (08:52 +0000)
commit09a6da013c6fac80291032c7082c47a4a73fbac7
tree0155c73377864ecc190338df1439bb6a9d6cfd1f
parent49b050dc8d4ad8533f3ffd7f102f0b5d44add541
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

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