Whamcloud - gitweb
LU-18897 o2iblnd: NULL pointer dereference 98/59498/3
authorCyril Bordage <cbordage@whamcloud.com>
Fri, 30 May 2025 16:07:08 +0000 (18:07 +0200)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 Jun 2025 06:37:22 +0000 (06:37 +0000)
When the network is flapping, we could get an
RDMA_CM_EVENT_UNREACHABLE event before conn is created, so we should
check the value first.

Test-Parameters: trivial
Signed-off-by: Cyril Bordage <cbordage@whamcloud.com>
Change-Id: I8d9777370b927c28ee438687de596e498d64bb07
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59498
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/klnds/o2iblnd/o2iblnd_cb.c

index b362c0d..556dddc 100644 (file)
@@ -3430,6 +3430,12 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
 
        case RDMA_CM_EVENT_UNREACHABLE:
                conn = cmid->context;
+
+               /* In case we have a flapping network, we can get this event
+                * before conn is created */
+               if (conn == NULL)
+                       return -ENETDOWN;
+
                CNETERR("%s: UNREACHABLE %d cm_id %p conn %p ibc_state: %d\n",
                        libcfs_nidstr(&conn->ibc_peer->ibp_nid),
                        event->status, cmid, conn, conn->ibc_state);