Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/cma: Only call cma_save_ib_info() for CM REQs

Calling cma_save_ib_info() for CM SIDR REQs results in a crash
accessing an invalid path record pointer.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>

authored by

Sean Hefty and committed by
Roland Dreier
5eb695c1 e511d1ae

+2 -1
+2 -1
drivers/infiniband/core/cma.c
··· 879 879 { 880 880 struct cma_hdr *hdr; 881 881 882 - if (listen_id->route.addr.src_addr.ss_family == AF_IB) { 882 + if ((listen_id->route.addr.src_addr.ss_family == AF_IB) && 883 + (ib_event->event == IB_CM_REQ_RECEIVED)) { 883 884 cma_save_ib_info(id, listen_id, ib_event->param.req_rcvd.primary_path); 884 885 return 0; 885 886 }