linux/drivers/infiniband/core
Leon Romanovsky f0abc761bb RDMA/core: Fix race between destroy and release FD object
The call to ->lookup_put() was too early and it caused an unlock of the
read/write protection of the uobject after the FD was put. This allows a
race:

     CPU1                                 CPU2
 rdma_lookup_put_uobject()
   lookup_put_fd_uobject()
     fput()
				   fput()
				     uverbs_uobject_fd_release()
				       WARN_ON(uverbs_try_lock_object(uobj,
					       UVERBS_LOOKUP_WRITE));
   atomic_dec(usecnt)

Fix the code by changing the order, first unlock and call to
->lookup_put() after that.

Fixes: 3832125624 ("IB/core: Add support for idr types")
Link: https://lore.kernel.org/r/20200423060122.6182-1-leon@kernel.org
Suggested-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2020-04-24 15:40:41 -03:00
..
addr.c
agent.c
agent.h
cache.c
cgroup.c
cm_msgs.h
cm.c RDMA/cm: Fix an error check in cm_alloc_id_priv() 2020-04-14 16:01:38 -03:00
cma_configfs.c
cma_priv.h
cma_trace.c
cma_trace.h
cma.c RDMA/cm: Update num_paths in cma_resolve_iboe_route error flow 2020-03-26 14:43:12 -03:00
core_priv.h
counters.c
cq.c
device.c RDMA/core: Fix missing error check on dev_set_name() 2020-03-13 10:30:11 -03:00
fmr_pool.c
ib_core_uverbs.c
iwcm.c
iwcm.h
iwpm_msg.c
iwpm_util.c
iwpm_util.h
mad_priv.h
mad_rmpp.c
mad_rmpp.h
mad.c
Makefile
mr_pool.c
multicast.c
netlink.c
nldev.c RDMA/nl: Do not permit empty devices names during RDMA_NLDEV_CMD_NEWLINK/SET 2020-03-13 10:23:38 -03:00
opa_smi.h
packer.c
rdma_core.c RDMA/core: Fix race between destroy and release FD object 2020-04-24 15:40:41 -03:00
rdma_core.h
restrack.c
restrack.h
roce_gid_mgmt.c
rw.c
sa_query.c
sa.h
security.c RDMA/core: Ensure security pkey modify is not lost 2020-03-24 19:53:25 -03:00
smi.c
smi.h
sysfs.c
trace.c
ucma.c
ud_header.c
umem_odp.c
umem.c
user_mad.c RDMA/mad: Do not crash if the rdma device does not have a umad interface 2020-03-13 10:32:02 -03:00
uverbs_cmd.c
uverbs_ioctl.c
uverbs_main.c RDMA/uverbs: Fix a race with disassociate and exit_mmap() 2020-04-22 15:43:46 -03:00
uverbs_marshall.c
uverbs_std_types_async_fd.c
uverbs_std_types_counters.c
uverbs_std_types_cq.c
uverbs_std_types_device.c
uverbs_std_types_dm.c
uverbs_std_types_flow_action.c
uverbs_std_types_mr.c
uverbs_std_types.c
uverbs_uapi.c
uverbs.h
verbs.c RDMA/core: Remove the duplicate header file 2020-03-10 14:34:54 -03:00