linux/drivers/infiniband/core
Krishna Kumar 6e35aabee1 RDMA/cma: Fix device removal race
The race is as follows:

A process : cma_process_remove() calls cma_remove_id_dev(),
	    which sets id state to CMA_DEVICE_REMOVAL and
	    calls wait_event(dev_remove).

B process : cma_req_handler() had incremented dev_remove,
	    and calls cma_acquire_ib_dev() and on failure
	    calls cma_release_remove(), which does a
	    wake_up of cma_process_remove(). Then
	    cma_req_handler() calls rdma_destroy_id();

A Process : cma_remove_id_dev() gets woken and checks the
	    state of id, and since it is still (wrongly)
	    CMA_DEVICE_REMOVAL, it calls notify_user(id)
	    and if that fails, the caller - cma_process_remove()
	    calls rdma_destroy_id(id). Two processes can
	    call rdma_destroy_id(), resulting in one
	    de-referencing kfreed id_priv.

Fix is for process B to set CMA_DESTROYING in cma_req_handler()
so that process A will return instead of doing a rdma_destroy_id().

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-10-02 14:52:15 -07:00
..
Makefile RDMA: iWARP Core Changes. 2006-09-22 15:22:47 -07:00
addr.c [IPV4]: annotate inetdev.h helpers 2006-09-28 18:01:05 -07:00
agent.c IB/mad: Simplify SMI by eliminating smi_check_local_dr_smp() 2006-03-20 10:08:11 -08:00
agent.h [PATCH] missing include in infiniband 2005-10-29 10:35:07 -07:00
cache.c RDMA: iWARP Core Changes. 2006-09-22 15:22:47 -07:00
cm.c IB/cm: Do not track remote QPN in timewait state 2006-09-22 15:22:53 -07:00
cm_msgs.h [IB] cm: Add missing break in switch 2005-10-20 12:29:36 -07:00
cma.c RDMA/cma: Fix device removal race 2006-10-02 14:52:15 -07:00
core_priv.h [PATCH] IB: move include files to include/rdma 2005-08-26 20:37:38 -07:00
device.c IB: Fix typo in kerneldoc for ib_set_client_data() 2006-09-22 15:22:58 -07:00
fmr_pool.c [PATCH] fmr pool: remove unnecessary pointer dereference 2006-07-14 21:53:51 -07:00
iwcm.c RDMA: iWARP Connection Manager. 2006-09-22 15:22:46 -07:00
iwcm.h RDMA: iWARP Connection Manager. 2006-09-22 15:22:46 -07:00
mad.c [PATCH] Really ignore kmem_cache_destroy return value 2006-09-27 08:26:10 -07:00
mad_priv.h [PATCH] missing includes from infiniband merge 2006-09-23 11:34:43 -07:00
mad_rmpp.c IB: Whitespace fixes 2006-09-22 15:22:46 -07:00
mad_rmpp.h [IB] Fix MAD layer DMA mappings to avoid touching data buffer once mapped 2005-10-25 10:51:39 -07:00
packer.c [PATCH] fix remaining missing includes 2005-11-07 07:53:41 -08:00
sa_query.c IB/sa: Require SA registration 2006-09-22 15:22:53 -07:00
smi.c RDMA: iWARP Core Changes. 2006-09-22 15:22:47 -07:00
smi.h IB/mad: Simplify SMI by eliminating smi_check_local_dr_smp() 2006-03-20 10:08:11 -08:00
sysfs.c RDMA: iWARP Core Changes. 2006-09-22 15:22:47 -07:00
ucm.c RDMA: iWARP Core Changes. 2006-09-22 15:22:47 -07:00
ud_header.c [PATCH] fix remaining missing includes 2005-11-07 07:53:41 -08:00
user_mad.c RDMA: iWARP Core Changes. 2006-09-22 15:22:47 -07:00
uverbs.h IB/uverbs: Avoid a crash on device hot remove 2006-08-03 10:56:42 -07:00
uverbs_cmd.c IB: Whitespace fixes 2006-09-22 15:22:46 -07:00
uverbs_main.c IB/uverbs: Avoid a crash on device hot remove 2006-08-03 10:56:42 -07:00
uverbs_marshall.c IB: common handling for marshalling parameters to/from userspace 2006-06-17 20:37:27 -07:00
uverbs_mem.c IB/uverbs: Don't leak ref to mm on error path 2006-05-17 22:20:50 -07:00
verbs.c RDMA: iWARP Core Changes. 2006-09-22 15:22:47 -07:00