Skip to content

Commit b61d92d

Browse files
Sean HeftyRoland Dreier
authored andcommitted
IB/mad: Fix incorrect access to items on local_list
In cancel_mads(), MADs are moved from the wait_list and local_list to a cancel_list for processing. However, the structures on these two lists are not the same. The wait_list references struct ib_mad_send_wr_private, but local_list references struct ib_mad_local_private. Cancel_mads() treats all items moved to the cancel_list as struct ib_mad_send_wr_private. This leads to a system crash when requests are moved from the local_list to the cancel_list. Fix this by leaving local_list alone. All requests on the local_list have completed are just awaiting processing by a queued worker thread. Bug (crash) reported by Dotan Barak <[email protected]>. Problem with local_list access reported by Robert Reynolds <[email protected]>. Signed-off-by: Sean Hefty <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
1 parent 9af57b7 commit b61d92d

File tree

1 file changed

+0
-2
lines changed
  • drivers/infiniband/core

1 file changed

+0
-2
lines changed

drivers/infiniband/core/mad.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,8 +2275,6 @@ static void cancel_mads(struct ib_mad_agent_private *mad_agent_priv)
22752275

22762276
/* Empty wait list to prevent receives from finding a request */
22772277
list_splice_init(&mad_agent_priv->wait_list, &cancel_list);
2278-
/* Empty local completion list as well */
2279-
list_splice_init(&mad_agent_priv->local_list, &cancel_list);
22802278
spin_unlock_irqrestore(&mad_agent_priv->lock, flags);
22812279

22822280
/* Report all cancelled requests */

0 commit comments

Comments
 (0)