linux/drivers/infiniband/hw
Kaike Wan a70ed0f2e6 IB/hfi1: Acquire lock to release TID entries when user file is closed
Each user context is allocated a certain number of RcvArray (TID)
entries and these entries are managed through TID groups. These groups
are put into one of three lists in each user context: tid_group_list,
tid_used_list, and tid_full_list, depending on the number of used TID
entries within each group. When TID packets are expected, one or more
TID groups will be allocated. After the packets are received, the TID
groups will be freed. Since multiple user threads may access the TID
groups simultaneously, a mutex exp_mutex is used to synchronize the
access. However, when the user file is closed, it tries to release
all TID groups without acquiring the mutex first, which risks a race
condition with another thread that may be releasing its TID groups,
leading to data corruption.

This patch addresses the issue by acquiring the mutex first before
releasing the TID groups when the file is closed.

Fixes: 3abb33ac65 ("staging/hfi1: Add TID cache receive init and free funcs")
Link: https://lore.kernel.org/r/20200210131026.87408.86853.stgit@awfm-01.aw.intel.com
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2020-02-11 11:41:31 -04:00
..
bnxt_re RDMA subsystem updates for 5.6 2020-01-31 14:40:36 -08:00
cxgb4 IB: Allow calls to ib_umem_get from kernel ULPs 2020-01-16 16:14:28 +02:00
efa RDMA/efa: Mask access flags with the correct optional range 2020-01-29 16:41:05 -04:00
hfi1 IB/hfi1: Acquire lock to release TID entries when user file is closed 2020-02-11 11:41:31 -04:00
hns Use ODP MRs for kernel ULPs 2020-01-21 09:55:04 -04:00
i40iw Use ODP MRs for kernel ULPs 2020-01-21 09:55:04 -04:00
mlx4 IB/mlx4: Fix leak in id_map_find_del 2020-01-27 16:46:53 -04:00
mlx5 RDMA subsystem updates for 5.6 2020-01-31 14:40:36 -08:00
mthca mm, tree-wide: rename put_user_page*() to unpin_user_page*() 2020-01-31 10:30:38 -08:00
ocrdma IB: Allow calls to ib_umem_get from kernel ULPs 2020-01-16 16:14:28 +02:00
qedr Use ODP MRs for kernel ULPs 2020-01-21 09:55:04 -04:00
qib mm, tree-wide: rename put_user_page*() to unpin_user_page*() 2020-01-31 10:30:38 -08:00
usnic mm, tree-wide: rename put_user_page*() to unpin_user_page*() 2020-01-31 10:30:38 -08:00
vmw_pvrdma IB: Allow calls to ib_umem_get from kernel ULPs 2020-01-16 16:14:28 +02:00
Makefile RDMA/iw_cxgb3: Remove the iw_cxgb3 module from kernel 2019-10-04 15:08:59 -03:00