1. 25 Mar, 2009 2 commits
  2. 19 Mar, 2009 2 commits
  3. 11 Mar, 2009 1 commit
  4. 06 Mar, 2009 8 commits
  5. 04 Mar, 2009 1 commit
  6. 03 Mar, 2009 2 commits
    • Jack Morgenstein's avatar
      IB/sa_query: Fix AH leak due to update_sm_ah() race · 6b708b3d
      Jack Morgenstein authored
      Our testing uncovered a race condition in ib_sa_event():
      
      	spin_lock_irqsave(&port->ah_lock, flags);
      	if (port->sm_ah)
      		kref_put(&port->sm_ah->ref, free_sm_ah);
      	port->sm_ah = NULL;
      	spin_unlock_irqrestore(&port->ah_lock, flags);
      
      	schedule_work(&sa_dev->port[event->element.port_num -
      				    sa_dev->start_port].update_task);
      
      If two events occur back-to-back (e.g., client-reregister and LID
      change), both may pass the spinlock-protected code above before the
      scheduled work updates the port->sm_ah handle.  Then if the scheduled
      work ends up running twice, the second operation will then find a
      non-NULL port->sm_ah, and will simply overwrite it in update_sm_ah --
      resulting in an AH leak.
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      6b708b3d
    • Ralph Campbell's avatar
      IB/mad: Fix ib_post_send_mad() returning 0 with no generate send comp · 4780c195
      Ralph Campbell authored
      If ib_post_send_mad() returns 0, the API guarantees that there will be
      a callback to send_buf->mad_agent->send_handler() so that the sender
      can call ib_free_send_mad().  Otherwise, the ib_mad_send_buf will be
      leaked and the mad_agent reference count will never go to zero and the
      IB device module cannot be unloaded.  The above can happen without
      this patch if process_mad() returns (IB_MAD_RESULT_SUCCESS |
      IB_MAD_RESULT_CONSUMED).
      
      If process_mad() returns IB_MAD_RESULT_SUCCESS and there is no agent
      registered to receive the mad being sent, handle_outgoing_dr_smp()
      returns zero which causes a MAD packet which is at the end of the
      directed route to be incorrectly sent on the wire but doesn't cause a
      hang since the HCA generates a send completion.
      Signed-off-by: default avatarRalph Campbell <ralph.campbell@qlogic.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      4780c195
  7. 27 Feb, 2009 5 commits
  8. 25 Feb, 2009 1 commit
    • Roland Dreier's avatar
      IB: Remove sysfs files before unregistering device · 9206dff1
      Roland Dreier authored
      Move the ib_device_unregister_sysfs() call from ib_dealloc_device() to
      ib_unregister_device().  The old code allows device unregister to
      proceed even if some sysfs files are open, which leaves a window where
      userspace can open a file before a device is removed but then end up
      reading the file after the device is removed, which leads to various
      kernel crashes either because the device data structure is freed or
      because the low-level driver code is gone after module removal.
      
      By not returning from ib_unregister_device() until after all sysfs
      entries are removed, we make sure that data structures and/or module
      code is not freed until after all sysfs access is done.
      Reported-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      9206dff1
  9. 23 Feb, 2009 2 commits
  10. 17 Feb, 2009 2 commits
  11. 11 Feb, 2009 2 commits
  12. 28 Jan, 2009 2 commits
    • Moni Shoua's avatar
      IB/mthca: Fix dispatch of IB_EVENT_LID_CHANGE event · 270b8b85
      Moni Shoua authored
      When snooping a PortInfo MAD, its client_reregister bit is checked.
      If the bit is ON then a CLIENT_REREGISTER event is dispatched,
      otherwise a LID_CHANGE event is dispatched.  This way of decision
      ignores the cases where the MAD changes the LID along with an
      instruction to reregister (so a necessary LID_CHANGE event won't be
      dispatched) or the MAD is neither of these (and an unnecessary
      LID_CHANGE event will be dispatched).
      
      This causes problems at least with IPoIB, which will do a "light"
      flush on reregister, rather than the "heavy" flush required due to a
      LID change.
      
      Fix this by dispatching a CLIENT_REREGISTER event if the
      client_reregister bit is set, but also compare the LID in the MAD to
      the current LID.  If and only if they are not identical then a
      LID_CHANGE event is dispatched.
      Signed-off-by: default avatarMoni Shoua <monis@voltaire.com>
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarYossi Etigin <yosefe@voltaire.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      270b8b85
    • Moni Shoua's avatar
      IB/mlx4: Fix dispatch of IB_EVENT_LID_CHANGE event · f0f6f346
      Moni Shoua authored
      When snooping a PortInfo MAD, its client_reregister bit is checked.
      If the bit is ON then a CLIENT_REREGISTER event is dispatched,
      otherwise a LID_CHANGE event is dispatched.  This way of decision
      ignores the cases where the MAD changes the LID along with an
      instruction to reregister (so a necessary LID_CHANGE event won't be
      dispatched) or the MAD is neither of these (and an unnecessary
      LID_CHANGE event will be dispatched).
      
      This causes problems at least with IPoIB, which will do a "light"
      flush on reregister, rather than the "heavy" flush required due to a
      LID change.
      
      Fix this by dispatching a CLIENT_REREGISTER event if the
      client_reregister bit is set, but also compare the LID in the MAD to
      the current LID.  If and only if they are not identical then a
      LID_CHANGE event is dispatched.
      Signed-off-by: default avatarMoni Shoua <monis@voltaire.com>
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarYossi Etigin <yosefe@voltaire.com>
      Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
      f0f6f346
  13. 18 Jan, 2009 1 commit
  14. 17 Jan, 2009 5 commits
  15. 16 Jan, 2009 4 commits