]> git.openfabrics.org - ~shefty/ibacm.git/commit
ibacm/ibacmp: fix a crash when SM restarts
authorKaike Wan <kaike.wan@intel.com>
Wed, 3 Dec 2014 20:14:44 +0000 (12:14 -0800)
committerSean Hefty <sean.hefty@intel.com>
Wed, 3 Dec 2014 20:14:44 +0000 (12:14 -0800)
commit46099fdf9c7f15ce73add352ac68f0e032021541
tree9cc7c88273d098da57bd8769668c3f5ce87f1a36
parent3aedaed70076ae9c524aaf840129cd0cb5e8fd79
ibacm/ibacmp: fix a crash when SM restarts

Ibacm may cause segfault when the SM restarts: when the SM restarts, ibacm will
receive P_Key change event and instruct ibacmp to close all endpoints. However,
ibacmp only resets the core endpoint pointer in its ep structure and keeps the ep
in the port's ep_list. Afterwards, the ibacm core will ask ibacmp to create
an ep for each pkey enumerated from the local port. The ep will be found
from the port's ep_list if it exists. However, if an old pkey is not present
in the new SM configuration, the old ep will still be linked in the port's
ep_list with the ep->endpoint being set to NULL. When the ibacm core forwards
the client reregistration event to ibacmp, ibacmp will enumerate the ep_list and
try to join multicast group for each ep, including any one with ep->endpoint
set to NULL. In this case, it will cause segfault in acm_send_sa_mad().
Additional check should be able to avoid the crash.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
prov/acmp/src/acmp.c
src/acm.c