summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/nes/nes_cm.h
diff options
context:
space:
mode:
authorFaisal Latif <faisal.latif@intel.com>2009-12-10 00:54:08 +0100
committerRoland Dreier <rolandd@cisco.com>2009-12-10 00:54:08 +0100
commitc5a7d4897156667a58fd8479f6227143573fe82d (patch)
tree9f8fed3529b5aa1ea8e8a991668b15094127161f /drivers/infiniband/hw/nes/nes_cm.h
parentRDMA/nes: Resource not freed for REJECTed connections (diff)
downloadlinux-c5a7d4897156667a58fd8479f6227143573fe82d.tar.xz
linux-c5a7d4897156667a58fd8479f6227143573fe82d.zip
RDMA/nes: Fix crash in nes_accept()
While running IMP_EXT's window test, we saw a crash in nes_accept(). Here is the sequence of what happened: (1) In MVAPICH2, connect request is received for port #0. FIX: Add a nes_connect() check to make sure local or remote tcp port is not 0. (2) Remote node's (passive) TCP stack sends a reset when it gets a connect request because of port = 0. Active side set the connect error to IW_CM_EVENT_STATUS_REJECTED when it received the RST from remote node. FIX: The corect error code is -ECONNRESET. (3) Wrong error code of IW_CM_EVENT_STATUS_REJECTED causes the core to destroy its listener ports. Here there are connections that may have sent an MPA request up and waiting for accept or reject. But the listener and its cm_nodes have been freed already causing the crash noticed. FIX: The cm_node is freed only if its state is not NES_CM_STATE_MPAREQ_RCVD. If cm_node's state is NES_CM_STATE_MPAREQ_RCVD then its new state is set to NES_CM_STATE_LISTENER_DESTROYED and it is not freed. When nes_accept() or nes_reject() is received, its state is checked for NES_CM_STATE_LISTENER_DESTROYED and in this case the cm_node is freed and error is returned. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/nes/nes_cm.h')
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.h b/drivers/infiniband/hw/nes/nes_cm.h
index 911846ae5c7d..d9825fda70a1 100644
--- a/drivers/infiniband/hw/nes/nes_cm.h
+++ b/drivers/infiniband/hw/nes/nes_cm.h
@@ -200,6 +200,7 @@ enum nes_cm_node_state {
NES_CM_STATE_TIME_WAIT,
NES_CM_STATE_LAST_ACK,
NES_CM_STATE_CLOSING,
+ NES_CM_STATE_LISTENER_DESTROYED,
NES_CM_STATE_CLOSED
};