Skip to contentSkip to conversation

osm_vl15intf.c: fixing use-after-free coredump

PATCH Applied Yevgeny Kliteynik 2 participants 2 messages Oct 11, 2010 – Oct 25, 2010 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

p_madw is freed if responce is not expected.

---
 opensm/opensm/osm_vl15intf.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
opensm/opensm/osm_vl15intf.c +3 -2
index bb2c0c6..c845597 100644
@@ -57,13 +57,14 @@
 static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw)
 {
 	ib_api_status_t status;
+	boolean_t resp_expected = p_madw->resp_expected;
 
 	/*
 	   Non-response-expected mads are not throttled on the wire
 	   since we can have no confirmation that they arrived
 	   at their destination.
 	 */
-	if (p_madw->resp_expected == TRUE)
+	if (resp_expected)
 		/*
 		   Note that other threads may not see the response MAD
 		   arrive before send() even returns.
@@ -103,7 +104,7 @@ static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw)
 	   qp0_mads_outstanding will be decremented by send error callback
 	   (called by osm_vendor_send() */
 	cl_atomic_dec(&p_vl->p_stats->qp0_mads_sent);
-	if (!p_madw->resp_expected)
+	if (!resp_expected)
 		cl_atomic_dec(&p_vl->p_stats->qp0_unicasts_sent);
 }
 
Signature · 6 lines
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4CB2EF36.2040209-VPRAkNaXOzVS1MOuV/[email protected]