freebsd-dev/sys/ofed/drivers/infiniband
Hans Petter Selasky 9fc6a63522 ibcore: Fix a race with disassociate and exit_mmap()
If uverbs_user_mmap_disassociate() is called while the mmap is
concurrently doing exit_mmap then the ordering of the
rdma_user_mmap_entry_put() is not reliable.

The put must be done before uvers_user_mmap_disassociate() returns,
otherwise there can be a use after free on the ucontext, and a left over
entry in the xarray. If the put is not done here then it is done during
rdma_umap_close() later.

Add the missing put to the error exit path.

Linux commit:
39c011a538272589b9eb02ff1228af528522a22c

PR:		264473
MFC after:	3 days
Sponsored by:	NVIDIA Networking
2022-06-21 11:33:27 +02:00
..
core ibcore: Fix a race with disassociate and exit_mmap() 2022-06-21 11:33:27 +02:00
ulp sockets: use socket buffer mutexes in struct socket directly 2022-05-12 13:22:12 -07:00
util Infiniband clients must be attached and detached in a specific order in ibcore. 2020-07-06 08:50:11 +00:00