<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/target, branch v3.2.78</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.78</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.78'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-10-13T02:46:01Z</updated>
<entry>
<title>target: REPORT LUNS should return LUN 0 even for dynamic ACLs</title>
<updated>2015-10-13T02:46:01Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=823713324fe26978a9c468b93a5af43444849a45'/>
<id>urn:sha1:823713324fe26978a9c468b93a5af43444849a45</id>
<content type='text'>
commit 9c395170a559d3b23dad100b01fc4a89d661c698 upstream.

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;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>target/iscsi: Fix double free of a TUR followed by a solicited NOPOUT</title>
<updated>2015-10-13T02:46:01Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1faeb78fa64ca582f3b4bb1d432564714431486a'/>
<id>urn:sha1:1faeb78fa64ca582f3b4bb1d432564714431486a</id>
<content type='text'>
commit 9547308bda296b6f69876c840a0291fcfbeddbb8 upstream.

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;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
[bwh: Backported to 3.2:
 - Adjust context
 - Keep the braces around the if-block]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>iscsi-target: Fix use-after-free during TPG session shutdown</title>
<updated>2015-08-12T14:33:23Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ba2bab3a5a790c67fc8afef5cee61dd7348615aa'/>
<id>urn:sha1:ba2bab3a5a790c67fc8afef5cee61dd7348615aa</id>
<content type='text'>
commit 417c20a9bdd1e876384127cf096d8ae8b559066c upstream.

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;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST</title>
<updated>2015-08-06T23:32:13Z</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2015-05-22T21:07:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=48793a2e5abc126a6446d8497c2117489622e9db'/>
<id>urn:sha1:48793a2e5abc126a6446d8497c2117489622e9db</id>
<content type='text'>
commit 5a7125c64def3b21f8147eca8b54949a60963942 upstream.

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

We need to put() the reference to the scsi host that we got in
pscsi_configure_device(). In VIRTUAL_HOST mode it is associated with
the dev_virt, not the hba_virt.

Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>target/pscsi: Fix NULL pointer dereference in get_device_type</title>
<updated>2015-05-09T22:16:30Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bf21de36006d41407c179164387984374b846943'/>
<id>urn:sha1:bf21de36006d41407c179164387984374b846943</id>
<content type='text'>
commit 215a8fe4198f607f34ecdbc9969dae783d8b5a61 upstream.

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;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>tcm_fc: missing curly braces in ft_invl_hw_context()</title>
<updated>2015-05-09T22:16:30Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6c3077af21b51bac1670e90704946ded71a34ce4'/>
<id>urn:sha1:6c3077af21b51bac1670e90704946ded71a34ce4</id>
<content type='text'>
commit d556546e7ecd9fca199df4698943024d40044f8e upstream.

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;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>iscsi-target: Drop problematic active_ts_list usage</title>
<updated>2015-05-09T22:16:16Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2015-01-22T08:56:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ab623fbc5a00f5525569e2c33b6b215e39a2453b'/>
<id>urn:sha1:ab623fbc5a00f5525569e2c33b6b215e39a2453b</id>
<content type='text'>
commit 3fd7b60f2c7418239d586e359e0c6d8503e10646 upstream.

This patch drops legacy active_ts_list usage within iscsi_target_tq.c
code.  It was originally used to track the active thread sets during
iscsi-target shutdown, and is no longer used by modern upstream code.

Two people have reported list corruption using traditional iscsi-target
and iser-target with the following backtrace, that appears to be related
to iscsi_thread_set-&gt;ts_list being used across both active_ts_list and
inactive_ts_list.

[   60.782534] ------------[ cut here ]------------
[   60.782543] WARNING: CPU: 0 PID: 9430 at lib/list_debug.c:53 __list_del_entry+0x63/0xd0()
[   60.782545] list_del corruption, ffff88045b00d180-&gt;next is LIST_POISON1 (dead000000100100)
[   60.782546] Modules linked in: ib_srpt tcm_qla2xxx qla2xxx tcm_loop tcm_fc libfc scsi_transport_fc scsi_tgt ib_isert rdma_cm iw_cm ib_addr iscsi_target_mod target_core_pscsi target_core_file target_core_iblock target_core_mod configfs ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 ipt_REJECT xt_CHECKSUM iptable_mangle iptable_filter ip_tables bridge stp llc autofs4 sunrpc ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 ib_ipoib ib_cm ib_uverbs ib_umad mlx4_en mlx4_ib ib_sa ib_mad ib_core mlx4_core dm_mirror dm_region_hash dm_log dm_mod vhost_net macvtap macvlan vhost tun kvm_intel kvm uinput iTCO_wdt iTCO_vendor_support microcode serio_raw pcspkr sb_edac edac_core sg i2c_i801 lpc_ich mfd_core mtip32xx igb i2c_algo_bit i2c_core ptp pps_core ioatdma dca wmi ext3(F) jbd(F) mbcache(F) sd_mod(F) crc_t10dif(F) crct10dif_common(F) ahci(F) libahci(F) isci(F) libsas(F) scsi_transport_sas(F) [last unloaded: speedstep_lib]
[   60.782597] CPU: 0 PID: 9430 Comm: iscsi_ttx Tainted: GF 3.12.19+ #2
[   60.782598] Hardware name: Supermicro X9DRX+-F/X9DRX+-F, BIOS 3.00 07/09/2013
[   60.782599]  0000000000000035 ffff88044de31d08 ffffffff81553ae7 0000000000000035
[   60.782602]  ffff88044de31d58 ffff88044de31d48 ffffffff8104d1cc 0000000000000002
[   60.782605]  ffff88045b00d180 ffff88045b00d0c0 ffff88045b00d0c0 ffff88044de31e58
[   60.782607] Call Trace:
[   60.782611]  [&lt;ffffffff81553ae7&gt;] dump_stack+0x49/0x62
[   60.782615]  [&lt;ffffffff8104d1cc&gt;] warn_slowpath_common+0x8c/0xc0
[   60.782618]  [&lt;ffffffff8104d2b6&gt;] warn_slowpath_fmt+0x46/0x50
[   60.782620]  [&lt;ffffffff81280933&gt;] __list_del_entry+0x63/0xd0
[   60.782622]  [&lt;ffffffff812809b1&gt;] list_del+0x11/0x40
[   60.782630]  [&lt;ffffffffa06e7cf9&gt;] iscsi_del_ts_from_active_list+0x29/0x50 [iscsi_target_mod]
[   60.782635]  [&lt;ffffffffa06e87b1&gt;] iscsi_tx_thread_pre_handler+0xa1/0x180 [iscsi_target_mod]
[   60.782642]  [&lt;ffffffffa06fb9ae&gt;] iscsi_target_tx_thread+0x4e/0x220 [iscsi_target_mod]
[   60.782647]  [&lt;ffffffffa06fb960&gt;] ? iscsit_handle_snack+0x190/0x190 [iscsi_target_mod]
[   60.782652]  [&lt;ffffffffa06fb960&gt;] ? iscsit_handle_snack+0x190/0x190 [iscsi_target_mod]
[   60.782655]  [&lt;ffffffff8106f99e&gt;] kthread+0xce/0xe0
[   60.782657]  [&lt;ffffffff8106f8d0&gt;] ? kthread_freezable_should_stop+0x70/0x70
[   60.782660]  [&lt;ffffffff8156026c&gt;] ret_from_fork+0x7c/0xb0
[   60.782662]  [&lt;ffffffff8106f8d0&gt;] ? kthread_freezable_should_stop+0x70/0x70
[   60.782663] ---[ end trace 9662f4a661d33965 ]---

Since this code is no longer used, go ahead and drop the problematic usage
all-together.

Reported-by: Gavin Guo &lt;gavin.guo@canonical.com&gt;
Reported-by: Moussa Ba &lt;moussaba@micron.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
[bwh: Backported to 3.2:
 - Adjust context
 - Also delete redundant initialisation, deleted upstream in commit
   d0f474e50192 ('target: Use LIST_HEAD()/DEFINE_MUTEX() for static objects')]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>iscsi-target: Fail connection on short sendmsg writes</title>
<updated>2015-02-20T00:49:31Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2014-11-21T04:50:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f7e7d869694bdbf4853f9a2ccb667d3bcfa5b240'/>
<id>urn:sha1:f7e7d869694bdbf4853f9a2ccb667d3bcfa5b240</id>
<content type='text'>
commit 6bf6ca7515c1df06f5c03737537f5e0eb191e29e upstream.

This patch changes iscsit_do_tx_data() to fail on short writes
when kernel_sendmsg() returns a value different than requested
transfer length, returning -EPIPE and thus causing a connection
reset to occur.

This avoids a potential bug in the original code where a short
write would result in kernel_sendmsg() being called again with
the original iovec base + length.

In practice this has not been an issue because iscsit_do_tx_data()
is only used for transferring 48 byte headers + 4 byte digests,
along with seldom used control payloads from NOPIN + TEXT_RSP +
REJECT with less than 32k of data.

So following Al's audit of iovec consumers, go ahead and fail
the connection on short writes for now, and remove the bogus
logic ahead of his proper upstream fix.

Reported-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>target: Fix queue full status NULL pointer for SCF_TRANSPORT_TASK_SENSE</title>
<updated>2014-12-14T16:23:46Z</updated>
<author>
<name>Quinn Tran</name>
<email>quinn.tran@qlogic.com</email>
</author>
<published>2014-09-25T10:22:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=877189882ca0d22b04c30b008a02296ea80a6164'/>
<id>urn:sha1:877189882ca0d22b04c30b008a02296ea80a6164</id>
<content type='text'>
commit 082f58ac4a48d3f5cb4597232cb2ac6823a96f43 upstream.

During temporary resource starvation at lower transport layer, command
is placed on queue full retry path, which expose this problem.  The TCM
queue full handling of SCF_TRANSPORT_TASK_SENSE currently sends the same
cmd twice to lower layer.  The 1st time led to cmd normal free path.
The 2nd time cause Null pointer access.

This regression bug was originally introduced v3.1-rc code in the
following commit:

commit e057f53308a5f071556ee80586b99ee755bf07f5
Author: Christoph Hellwig &lt;hch@infradead.org&gt;
Date:   Mon Oct 17 13:56:41 2011 -0400

    target: remove the transport_qf_callback se_cmd callback

Signed-off-by: Quinn Tran &lt;quinn.tran@qlogic.com&gt;
Signed-off-by: Saurav Kashyap &lt;saurav.kashyap@qlogic.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure</title>
<updated>2014-11-05T20:27:44Z</updated>
<author>
<name>Joern Engel</name>
<email>joern@logfs.org</email>
</author>
<published>2014-09-02T21:49:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=63cb95ba25b2377728536a8114cd05105dd370d4'/>
<id>urn:sha1:63cb95ba25b2377728536a8114cd05105dd370d4</id>
<content type='text'>
commit 8ae757d09c45102b347a1bc2867f54ffc1ab8fda upstream.

In iscsi_copy_param_list() a failed iscsi_param_list memory allocation
currently invokes iscsi_release_param_list() to cleanup, and will promptly
trigger a NULL pointer dereference.

Instead, go ahead and return for the first iscsi_copy_param_list()
failure case.

Found by coverity.

Signed-off-by: Joern Engel &lt;joern@logfs.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
</feed>
