<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/target, branch v4.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.2</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-08-19T04:51:54Z</updated>
<entry>
<title>target: Fix handling of small allocation lengths in REPORT LUNS</title>
<updated>2015-08-19T04:51:54Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2015-08-14T04:59:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f69a38737538c8a265f75d26996818f98c899e4'/>
<id>urn:sha1:0f69a38737538c8a265f75d26996818f98c899e4</id>
<content type='text'>
REPORT LUNS should not fail just because the allocation length is less
than 16.  The relevant section of SPC-4 is:

  4.2.5.6 Allocation length

  The ALLOCATION LENGTH field specifies the maximum number of bytes or
  blocks that an application client has allocated in the Data-In
  Buffer. The ALLOCATION LENGTH field specifies bytes unless a
  different requirement is stated in the command definition.

  An allocation length of zero specifies that no data shall be
  transferred. This condition shall not be considered an error.

So we should just truncate our response rather than return an error.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Spencer Baugh &lt;sbaugh@catern.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: REPORT LUNS should return LUN 0 even for dynamic ACLs</title>
<updated>2015-08-03T05:12:18Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2015-07-24T19:11:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9c395170a559d3b23dad100b01fc4a89d661c698'/>
<id>urn:sha1:9c395170a559d3b23dad100b01fc4a89d661c698</id>
<content type='text'>
If an initiator doesn't have any real LUNs assigned, we should report
LUN 0 and a LUN list length of 1.  Some versions of Solaris at least
go beserk if we report a LUN list length of 0.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.1+
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target/iscsi: Fix double free of a TUR followed by a solicited NOPOUT</title>
<updated>2015-07-31T06:10:54Z</updated>
<author>
<name>Alexei Potashnik</name>
<email>alexei@purestorage.com</email>
</author>
<published>2015-07-21T22:07:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9547308bda296b6f69876c840a0291fcfbeddbb8'/>
<id>urn:sha1:9547308bda296b6f69876c840a0291fcfbeddbb8</id>
<content type='text'>
Make sure all non-READ SCSI commands get targ_xfer_tag initialized
to 0xffffffff, not just WRITEs.

Double-free of a TUR cmd object occurs under the following scenario:

1. TUR received (targ_xfer_tag is uninitialized and left at 0)
2. TUR status sent
3. First unsolicited NOPIN is sent to initiator (gets targ_xfer_tag of 0)
4. NOPOUT for NOPIN (with TTT=0) arrives
 - its ExpStatSN acks TUR status, TUR is queued for removal
 - LIO tries to find NOPIN with TTT=0, but finds the same TUR instead,
   TUR is queued for removal for the 2nd time

(Drop unbalanced conditional bracket usage - nab)

Signed-off-by: Alexei Potashnik &lt;alexei@purestorage.com&gt;
Signed-off-by: Spencer Baugh &lt;sbaugh@catern.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.1+
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Perform RCU callback barrier before backend/fabric unload</title>
<updated>2015-07-31T05:06:29Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2015-07-30T05:27:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9450918293b3c35f11883231a53da1aed2c78403'/>
<id>urn:sha1:9450918293b3c35f11883231a53da1aed2c78403</id>
<content type='text'>
This patch addresses a v4.2-rc1 regression where backend driver
module unload happening immediately after TBO-&gt;free_device()
does internal call_rcu(), will currently result in IRQ context
rcu_process_callbacks() use-after-free paging OOPsen.

It adds the missing rcu_barrier() in target_backend_unregister()
to perform an explicit RCU barrier waiting for all RCU callbacks
to complete before releasing target_backend_ops memory, and
allowing TBO-&gt;module exit to proceed.

Also, do the same for fabric drivers in target_unregister_template()
to ensure se_deve_entry-&gt;rcu_head -&gt; kfree_rcu() callbacks have
completed, before allowing target_core_fabric_ops-&gt;owner module
exit to proceed.

Acked-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Cc: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>iscsi-target: Fix iser explicit logout TX kthread leak</title>
<updated>2015-07-24T21:19:44Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2015-07-23T22:30:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=007d038bdf95ccfe2491d0078be54040d110fd06'/>
<id>urn:sha1:007d038bdf95ccfe2491d0078be54040d110fd06</id>
<content type='text'>
This patch fixes a regression introduced with the following commit
in v4.0-rc1 code, where an explicit iser-target logout would result
in -&gt;tx_thread_active being incorrectly cleared by the logout post
handler, and subsequent TX kthread leak:

    commit 88dcd2dab5c23b1c9cfc396246d8f476c872f0ca
    Author: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
    Date:   Thu Feb 26 22:19:15 2015 -0800

        iscsi-target: Convert iscsi_thread_set usage to kthread.h

To address this bug, change iscsit_logout_post_handler_closesession()
and iscsit_logout_post_handler_samecid() to only cmpxchg() on
-&gt;tx_thread_active for traditional iscsi/tcp connections.

This is required because iscsi/tcp connections are invoking logout
post handler logic directly from TX kthread context, while iser
connections are invoking logout post handler logic from a seperate
workqueue context.

Cc: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.10+
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>iscsi-target: Fix iscsit_start_kthreads failure OOPs</title>
<updated>2015-07-24T21:19:43Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2015-07-23T06:14:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e54198657b65625085834847ab6271087323ffea'/>
<id>urn:sha1:e54198657b65625085834847ab6271087323ffea</id>
<content type='text'>
This patch fixes a regression introduced with the following commit
in v4.0-rc1 code, where a iscsit_start_kthreads() failure triggers
a NULL pointer dereference OOPs:

    commit 88dcd2dab5c23b1c9cfc396246d8f476c872f0ca
    Author: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
    Date:   Thu Feb 26 22:19:15 2015 -0800

        iscsi-target: Convert iscsi_thread_set usage to kthread.h

To address this bug, move iscsit_start_kthreads() immediately
preceeding the transmit of last login response, before signaling
a successful transition into full-feature-phase within existing
iscsi_target_do_tx_login_io() logic.

This ensures that no target-side resource allocation failures can
occur after the final login response has been successfully sent.

Also, it adds a iscsi_conn-&gt;rx_login_comp to allow the RX thread
to sleep to prevent other socket related failures until the final
iscsi_post_login_handler() call is able to complete.

Cc: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.10+
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>iscsi-target: Fix use-after-free during TPG session shutdown</title>
<updated>2015-07-24T21:19:43Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2015-07-22T07:24:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=417c20a9bdd1e876384127cf096d8ae8b559066c'/>
<id>urn:sha1:417c20a9bdd1e876384127cf096d8ae8b559066c</id>
<content type='text'>
This patch fixes a use-after-free bug in iscsit_release_sessions_for_tpg()
where se_portal_group-&gt;session_lock was incorrectly released/re-acquired
while walking the active se_portal_group-&gt;tpg_sess_list.

The can result in a NULL pointer dereference when iscsit_close_session()
shutdown happens in the normal path asynchronously to this code, causing
a bogus dereference of an already freed list entry to occur.

To address this bug, walk the session list checking for the same state
as before, but move entries to a local list to avoid dropping the lock
while walking the active list.

As before, signal using iscsi_session-&gt;session_restatement=1 for those
list entries to be released locally by iscsit_free_session() code.

Reported-by: Sunilkumar Nadumuttlu &lt;sjn@datera.io&gt;
Cc: Sunilkumar Nadumuttlu &lt;sjn@datera.io&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.1+
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target/configfs: handle match_int() errors</title>
<updated>2015-07-24T06:41:22Z</updated>
<author>
<name>David Disseldorp</name>
<email>ddiss@suse.de</email>
</author>
<published>2015-07-12T16:49:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c20910264c367a5dfbf6c09e8ec2ff0c5c52857a'/>
<id>urn:sha1:c20910264c367a5dfbf6c09e8ec2ff0c5c52857a</id>
<content type='text'>
As a follow up to ce31c1b0dc4038a1dec64585d892adb73d9c45f4 - there are
still a few LIO match_int() calls that don't check the return value.
Propagate errors rather than using the potentially uninitialised result.

Signed-off-by: David Disseldorp &lt;ddiss@suse.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Do not return 0 from aptpl and alua configfs store functions</title>
<updated>2015-07-24T06:40:01Z</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2015-07-09T16:56:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9105bfc038ca5a506404ce37cd3c0e85f76351e3'/>
<id>urn:sha1:9105bfc038ca5a506404ce37cd3c0e85f76351e3</id>
<content type='text'>
Here are some more instances where we are returning 0 from a configfs
store function, the unintended result of which is likely infinite retries
from userspace.

Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Indicate success if writing 0 to pi_prot_type</title>
<updated>2015-07-24T06:39:59Z</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2015-07-09T16:56:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bc1a7d6aff763ea29db6319185327f86b0fe93b6'/>
<id>urn:sha1:bc1a7d6aff763ea29db6319185327f86b0fe93b6</id>
<content type='text'>
See https://bugzilla.redhat.com/show_bug.cgi?id=1240687

Returning 0 from a configfs store function results in infinite retries.

Reported-by: Yanko Kaneti &lt;yaneti@declera.com&gt;
Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
</feed>
