[openib-general] [PATCH] osm: lib vendor race cause OpenSM crashes

Eitan Zahavi eitan at mellanox.co.il
Wed Jan 18 07:58:11 PST 2006


Hi Hal

We have found a race in OpenSM that can cause an active madw be 
returned during the transaction. This is a fatal high priority 
bug as it very likely cause a crash.

Eitan

Signed-off-by:  Eitan Zahavi <eitan at mellanox.co.il>
Index: libvendor/osm_vendor_ibumad.c
===================================================================
--- libvendor/osm_vendor_ibumad.c	(revision 5009)
+++ libvendor/osm_vendor_ibumad.c	(working copy)
@@ -138,14 +138,16 @@ get_madw(osm_vendor_t *p_vend, ib_net64_
 {
 	umad_match_t *m, *e;
 	ib_net64_t mtid = (*tid & 0xffffffff00000000llu);
+	osm_madw_t *res;
 
 	cl_spinlock_acquire( &p_vend->match_tbl_lock );
 	for (m = p_vend->mtbl.tbl, e = m + p_vend->mtbl.max; m < e; m++) {
 		if (m->tid == mtid) {
 			m->tid = 0;
 			*tid = mtid;
+ 			res = m->v;
 			cl_spinlock_release( &p_vend->match_tbl_lock );
-			return m->v;
+			return res;
 		}
 	}
 





More information about the general mailing list