]> git.openfabrics.org - ~shefty/rdma-win.git/commit
dapl/cma: fix referencing freed address
authorSean Hefty <sean.hefty@intel.com>
Sat, 23 Jan 2010 07:28:57 +0000 (23:28 -0800)
committerSean Hefty <sean.hefty@intel.com>
Sat, 23 Jan 2010 07:28:57 +0000 (23:28 -0800)
commit5e7301be73b8098ed531565b32859d112fae5e35
tree3f957c908fe3d970e73ec937d5ffc55552925584
parente91637f797fd38ddec0675d43088600f82c10f75
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>