<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/target, branch v4.0</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.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-04-10T19:33:55Z</updated>
<entry>
<title>iscsi target: fix oops when adding reject pdu</title>
<updated>2015-04-10T19:33:55Z</updated>
<author>
<name>Mike Christie</name>
<email>michaelc@cs.wisc.edu</email>
</author>
<published>2015-04-10T07:47:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b815fc12d4dd2b5586184fb4f867caff05a810d4'/>
<id>urn:sha1:b815fc12d4dd2b5586184fb4f867caff05a810d4</id>
<content type='text'>
This fixes a oops due to a double list add when adding a reject PDU for
iscsit_allocate_iovecs allocation failures. The cmd has already been
added to the conn_cmd_list in iscsit_setup_scsi_cmd, so this has us call
iscsit_reject_cmd.

Note that for ERL0 the reject PDU is not actually sent, so this patch
is not completely tested. Just verified we do not oops. The problem is the
add reject functions return -1 which is returned all the way up to
iscsi_target_rx_thread which for ERL0 will drop the connection.

Signed-off-by: Mike Christie &lt;michaelc@cs.wisc.edu&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: TargetAddress in SendTargets should bracket ipv6 addresses</title>
<updated>2015-04-08T00:41:54Z</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2015-03-31T17:43:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1997e625963e24994a81070fef169e78965f6496'/>
<id>urn:sha1:1997e625963e24994a81070fef169e78965f6496</id>
<content type='text'>
"The domainname can be specified as either a DNS host name, a
dotted-decimal IPv4 address, or a bracketed IPv6 address as specified
in [RFC2732]."

See https://bugzilla.redhat.com/show_bug.cgi?id=1206868

Reported-by: Kyle Brantley &lt;kyle@averageurl.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>
<entry>
<title>target: Allow userspace to write 1 to attrib/emulate_fua_write</title>
<updated>2015-04-02T04:42:51Z</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2015-03-31T22:04:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=86d65dc4fe74d5b3228fe13c5eff0b10ae6808eb'/>
<id>urn:sha1:86d65dc4fe74d5b3228fe13c5eff0b10ae6808eb</id>
<content type='text'>
Before 4.0, reading attrib/emulate_fua_write has returned 1. Saved
configs created on a pre-4.0 kernel will try to write that back when
restoring LIO configuration. This should succeed with no effect,
and issue a warning.

See https://bugzilla.redhat.com/show_bug.cgi?id=1206184

Reported-by: Yanko Kaneti &lt;yaneti@declera.com&gt;
Reported-by: Juan Quintela &lt;quintela@redhat.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>
<entry>
<title>target: do not reject FUA CDBs when write cache is enabled but emulate_write_cache is 0</title>
<updated>2015-03-20T06:26:46Z</updated>
<author>
<name>Christophe Vu-Brugier</name>
<email>cvubrugier@fastmail.fm</email>
</author>
<published>2015-03-19T13:30:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9bc6548f372d8c829235095d91de99d8df79db6e'/>
<id>urn:sha1:9bc6548f372d8c829235095d91de99d8df79db6e</id>
<content type='text'>
A check that rejects a CDB with FUA bit set if no write cache is
emulated was added by the following commit:

  fde9f50 target: Add sanity checks for DPO/FUA bit usage

The condition is as follows:

  if (!dev-&gt;dev_attrib.emulate_fua_write ||
      !dev-&gt;dev_attrib.emulate_write_cache)

However, this check is wrong if the backend device supports WCE but
"emulate_write_cache" is disabled.

This patch uses se_dev_check_wce() (previously named
spc_check_dev_wce) to invoke transport-&gt;get_write_cache() if the
device has a write cache or check the "emulate_write_cache" attribute
otherwise.

Reported-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Christophe Vu-Brugier &lt;cvubrugier@fastmail.fm&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Fix virtual LUN=0 target_configure_device failure OOPs</title>
<updated>2015-03-20T06:26:44Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2015-03-05T03:28:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f7da044f8bc1cfb21c962edf34bd5699a76e7ae'/>
<id>urn:sha1:5f7da044f8bc1cfb21c962edf34bd5699a76e7ae</id>
<content type='text'>
This patch fixes a NULL pointer dereference triggered by a late
target_configure_device() -&gt; alloc_workqueue() failure that results
in target_free_device() being called with DF_CONFIGURED already set,
which subsequently OOPses in destroy_workqueue() code.

Currently this only happens at modprobe target_core_mod time when
core_dev_setup_virtual_lun0() -&gt; target_configure_device() fails,
and the explicit target_free_device() gets called.

To address this bug originally introduced by commit 0fd97ccf45, go
ahead and move DF_CONFIGURED to end of target_configure_device()
code to handle this special failure case.

Reported-by: Claudio Fleiner &lt;cmf@daterainc.com&gt;
Cc: Claudio Fleiner &lt;cmf@daterainc.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.7+
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target/pscsi: Fix NULL pointer dereference in get_device_type</title>
<updated>2015-03-20T06:26:42Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2015-02-27T11:54:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=215a8fe4198f607f34ecdbc9969dae783d8b5a61'/>
<id>urn:sha1:215a8fe4198f607f34ecdbc9969dae783d8b5a61</id>
<content type='text'>
This patch fixes a NULL pointer dereference OOPs with pSCSI backends
within target_core_stat.c code.  The bug is caused by a configfs attr
read if no pscsi_dev_virt-&gt;pdv_sd has been configured.

Reported-by: Olaf Hering &lt;olaf@aepfle.de&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>tcm_fc: missing curly braces in ft_invl_hw_context()</title>
<updated>2015-03-20T06:26:41Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2015-02-25T13:21:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d556546e7ecd9fca199df4698943024d40044f8e'/>
<id>urn:sha1:d556546e7ecd9fca199df4698943024d40044f8e</id>
<content type='text'>
This patch adds a missing set of conditional check braces in
ft_invl_hw_context() originally introduced by commit dcd998ccd
when handling DDP failures in ft_recv_write_data() code.

 commit dcd998ccdbf74a7d8fe0f0a44e85da1ed5975946
 Author: Kiran Patil &lt;kiran.patil@intel.com&gt;
 Date:   Wed Aug 3 09:20:01 2011 +0000

    tcm_fc: Handle DDP/SW fc_frame_payload_get failures in ft_recv_write_data

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: Kiran Patil &lt;kiran.patil@intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 3.1+
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Fix reference leak in target_get_sess_cmd() error path</title>
<updated>2015-03-20T06:26:31Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2015-02-18T14:33:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7544e597343e2166daba3f32e4708533aa53c233'/>
<id>urn:sha1:7544e597343e2166daba3f32e4708533aa53c233</id>
<content type='text'>
This patch fixes a se_cmd-&gt;cmd_kref leak buf when se_sess-&gt;sess_tearing_down
is true within target_get_sess_cmd() submission path code.

This se_cmd reference leak can occur during active session shutdown when
ack_kref=1 is passed by target_submit_cmd_[map_sgls,tmr]() callers.

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 3.6+
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>loop/usb/vhost-scsi/xen-scsiback: Fix use of __transport_register_session</title>
<updated>2015-03-20T06:15:14Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2015-02-12T10:48:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2f450cc1fbe9713f79b217e61ab204e263723ead'/>
<id>urn:sha1:2f450cc1fbe9713f79b217e61ab204e263723ead</id>
<content type='text'>
This patch changes loopback, usb-gadget, vhost-scsi and xen-scsiback
fabric code to invoke transport_register_session() instead of the
unprotected flavour, to ensure se_tpg-&gt;session_lock is taken when
adding new session list nodes to se_tpg-&gt;tpg_sess_list.

Note that since these four fabric drivers already hold their own
internal TPG mutexes when accessing se_tpg-&gt;tpg_sess_list, and
consist of a single se_session created through configfs attribute
access, no list corruption can currently occur.

So for correctness sake, go ahead and use the se_tpg-&gt;session_lock
protected version for these four fabric drivers.

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>iscsi-target: Avoid early conn_logout_comp for iser connections</title>
<updated>2015-03-20T06:10:01Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2015-02-23T08:57:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f068fbc82e7696d67b1bb8189306865bedf368b6'/>
<id>urn:sha1:f068fbc82e7696d67b1bb8189306865bedf368b6</id>
<content type='text'>
This patch fixes a iser specific logout bug where early complete()
of conn-&gt;conn_logout_comp in iscsit_close_connection() was causing
isert_wait4logout() to complete too soon, triggering a use after
free NULL pointer dereference of iscsi_conn memory.

The complete() was originally added for traditional iscsi-target
when a ISCSI_LOGOUT_OP failed in iscsi_target_rx_opcode(), but given
iser-target does not wait in logout failure, this special case needs
to be avoided.

Reported-by: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Cc: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Cc: Slava Shwartsman &lt;valyushash@gmail.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.10+
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
</feed>
