mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@daterainc.com>
To: target-devel <target-devel@vger.kernel.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Sagi Grimberg <sagig@mellanox.com>,
	Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>,
	Andy Grover <agrover@redhat.com>,
	Vasu Dev <vasu.dev@linux.intel.com>, Vu Pham <vu@mellanox.com>,
	Nicholas Bellinger <nab@linux-iscsi.org>
Subject: [PATCH 0/4] target: Close se_node_acl lookup race
Date: Fri,  8 Jan 2016 07:15:44 +0000	[thread overview]
Message-ID: <1452237348-2277-1-git-send-email-nab@daterainc.com> (raw)

From: Nicholas Bellinger <nab@linux-iscsi.org>

Hi folks,

This series addresses a long standing race between when
fabric driver se_node_acl lookup and associated pointer
dereference happens, and when kref_get() of ->acl_kref
actually occurs within __transport_register_session()
code.

To address this bug, patch #1 makes get_initiator_node_acl
lookup obtain ->acl_kref while ->acl_node_mutex is held,
and uses existing core_tpg_del_initiator_node_acl() logic
for shutdown based on struct kref + struct completion.

Also while auditing existing se_node_acl lookup users,
there is one particular case in target-core during session
queue depth change where lookup is completely unnecessary.
Go ahead and drop this pointless lookup in patch #2.

Finally, convert the last two remaining fabric drivers
that once upon a time where using some manner of internal
or quasi internal driver methods for node acl lookup.
Do this for tcm_fc + ib_srpt drivers in patch #3 + #4.

Please review,

--nab

Nicholas Bellinger (4):
  target: Obtain se_node_acl->acl_kref during get_initiator_node_acl
  target: Remove useless set_initiator_node_queue_depth acl lookup
  tcm_fc: Convert acl lookup to modern get_initiator_node_acl usage
  ib_srpt: Convert acl lookup to modern get_initiator_node_acl usage

 drivers/infiniband/ulp/srpt/ib_srpt.c        | 78 ++++++----------------------
 drivers/infiniband/ulp/srpt/ib_srpt.h        |  2 -
 drivers/target/iscsi/iscsi_target_configfs.c |  6 +--
 drivers/target/iscsi/iscsi_target_tpg.c      | 10 ----
 drivers/target/iscsi/iscsi_target_tpg.h      |  2 -
 drivers/target/target_core_tpg.c             | 29 ++++-------
 drivers/target/target_core_transport.c       | 18 ++++---
 drivers/target/tcm_fc/tfc_conf.c             | 26 +++-------
 drivers/target/tcm_fc/tfc_sess.c             | 18 ++++---
 include/target/target_core_fabric.h          |  2 +-
 10 files changed, 61 insertions(+), 130 deletions(-)

-- 
1.9.1

             reply	other threads:[~2016-01-08  7:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08  7:15 Nicholas A. Bellinger [this message]
2016-01-08  7:15 ` [PATCH 1/4] target: Obtain se_node_acl->acl_kref during get_initiator_node_acl Nicholas A. Bellinger
2016-01-08  8:14   ` Christoph Hellwig
2016-01-08  8:31     ` Bart Van Assche
2016-01-08  8:35       ` Christoph Hellwig
2016-01-08  8:47       ` Nicholas A. Bellinger
2016-01-08  9:08         ` Christoph Hellwig
2016-01-08  9:37           ` Christoph Hellwig
2016-01-08  7:15 ` [PATCH 2/4] target: Remove useless set_initiator_node_queue_depth acl lookup Nicholas A. Bellinger
2016-01-08  8:17   ` Christoph Hellwig
2016-01-08  7:15 ` [PATCH 3/4] tcm_fc: Convert acl lookup to modern get_initiator_node_acl usage Nicholas A. Bellinger
2016-01-08  8:21   ` Christoph Hellwig
2016-01-08  9:05     ` Christoph Hellwig
2016-01-08  7:15 ` [PATCH 4/4] ib_srpt: " Nicholas A. Bellinger
2016-01-08  8:52   ` Bart Van Assche
2016-01-08  9:17     ` Nicholas A. Bellinger
2016-01-08  9:35       ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452237348-2277-1-git-send-email-nab@daterainc.com \
    --to=nab@daterainc.com \
    --cc=agrover@redhat.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=sagig@mellanox.com \
    --cc=target-devel@vger.kernel.org \
    --cc=vasu.dev@linux.intel.com \
    --cc=vu@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®