1. 13 6月, 2012 5 次提交
    • R
      qla2xxx: Don't leak commands we give up on in qlt_do_work() · fae9eaf8
      Roland Dreier 提交于
      If we go to the "out_term:" exit path in qlt_do_work(), we call
      qlt_send_term_exchange() with a NULL cmd, which means that it can't
      possibly free the cmd for us.  Add an explicit call to free the
      command memory, so we don't leak the allocation.
      
      This will also fix warnings about "BUG qla_tgt_cmd_cachep: Objects
      remaining on kmem_cache_close" from slub when unloading the qla2xxx
      target module.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      fae9eaf8
    • R
      qla2xxx: Don't crash if we can't find cmd for failed CTIO · 092e1dc3
      Roland Dreier 提交于
      In qlt_do_ctio_completion(), there's no point in calling
      qlt_term_ctio_exchange() with a NULL cmd -- all that it does is crash
      in a NULL pointer dereference, since it does
      
      	qlt_send_term_exchange(vha, cmd, &cmd->atio, 1);
      
      and dereferencing &cmd->atio is a bad idea if cmd itself is NULL.
      
      If we really need to do this, we could take the values from the
      failed CTIO we're processing, but it's not clear if it's worth
      the replumbing to do that.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      092e1dc3
    • R
      tcm_qla2xxx: Don't insert nacls without sessions into the btree · 3578ddba
      Roland Dreier 提交于
      When we create an explicit node ACL in tcm_qla2xxx_make_nodeacl(),
      there is a call to tcm_qla2xxx_setup_nacl_from_rport(), which puts the
      node ACL into the lport_fcport_map even though there is no session yet
      for the initiator.  Since the only time we remove entries from this
      map is when we free a session, this means that if we later delete this
      node ACL without the initiator ever creating a session, we'll leave
      the nacl pointer in the btree pointing at freed memory.
      
      This is especially bad if that initiator later does send us a command
      that would cause us to create a dynamic ACL and session: we'll find
      the stale freed nacl pointer in the btree and end up with use-after-free.
      
      We could add more code to clear the btree entry when deleting the
      explicit nacl, but the original insertion is pointless: without a
      session attached, we'll just have to update the entry when a session
      appears anyway.  So we can just delete tcm_qla2xxx_setup_nacl_from_rport()
      and the code that calls it.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: Chad Dupuis <chad.dupuis@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3578ddba
    • N
      tcm_qla2xxx: Clear session s_id + loop_id earlier during shutdown · f2d5d9b9
      Nicholas Bellinger 提交于
      This patch adds a new tcm_qla2xxx_clear_sess_lookup() call to clear session
      specific s_id + loop_id entries used for se_node_acl pointer lookup ahead
      of releasing se_session within the process context workqueue callback in
      tcm_qla2xxx_free_session().
      
      It makes the call in existing tcm_qla2xxx_clear_nacl_from_fcport_map()
      code invoked from qlt_unreg_sess() in interrupt context w/ hardware_lock
      held, ahead of the process context callback into qlt_free_session_done()
      -> tcm_qla2xxx_free_session().
      
      We are doing this to address a race between incoming ATIO or TMR packets
      using stale se_node_acl pointer once session shutdown has been invoked via
      qlt_unreg_sess() in qla_target.c LLD code, and when the entire tcm_qla2xxx
      endpoint has not been forced into shutdown w/ echo 0 > ../$QLA2XXX_PORT/enable
      
      Cc: Joern Engel <joern@logfs.org>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f2d5d9b9
    • J
      tcm_qla2xxx: Convert to TFO->put_session() usage · aaf68b75
      Joern Engel 提交于
      This patch converts tcm_qla2xxx code to use an internal kref_put() for
      se_session->sess_kref in order to ensure that qla_hw_data->hardware_lock
      can be held while calling qlt_unreg_sess() for the final put.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      aaf68b75
  2. 22 5月, 2012 23 次提交
  3. 10 5月, 2012 5 次提交
  4. 30 4月, 2012 1 次提交
  5. 01 3月, 2012 1 次提交
  6. 19 2月, 2012 5 次提交