]> git.openfabrics.org - ~ardavis/dapl.git/commit
dapl/cma: fix referencing freed address
authorSean Hefty <sean.hefty@intel.com>
Thu, 28 Jan 2010 18:19:20 +0000 (10:19 -0800)
committerArlin Davis <arlin.r.davis@intel.com>
Thu, 28 Jan 2010 18:19:20 +0000 (10:19 -0800)
commit5da33bb3b9c230c08492f85d13caa330ce65906e
tree87dafd907ed6788f3d586d7d92ddb0e8c6604444
parent66dbb5f20bf494eb3f5041655b478059165c5f1b
dapl/cma: fix referencing freed address

DAPL uses a pointer to reference the local and remote addresses
of an endpoint.  It expects that those addresses are located
in memory that is always accessible.  Typically, for the local
address, the pointer references the address stored with the DAPL
HCA device.  However, for the cma provider, it changes this pointer
to reference the address stored with the rdma_cm_id.

This causes a problem when that endpoint is connected on the
passive side of a connection.  When connect requests are given
to DAPL, a new rdma_cm_id is associated with the request.  The
DAPL code replaces the current rdma_cm_id associated with a
user's endpoint with the new rdma_cm_id.  The old rdma_cm_id is
then deleted.  But the endpoint's local address pointer still
references the address stored with the old rdma_cm_id.  The
result is that any reference to the address will access freed
memory.

Fix this by keeping the local address pointer always pointing
to the address associated with the DAPL HCA device.  This is about
the best that can be done given the DAPL interface design.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
dapl/openib_common/qp.c