Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [added to the 3.18 stable tree] iscsi-target: Fix rx_login_comp hang after login failure
@ 2016-03-13 17:52 Sasha Levin
  2016-03-13 17:52 ` [added to the 3.18 stable tree] target: Fix race for SCF_COMPARE_AND_WRITE_POST checking Sasha Levin
                   ` (89 more replies)
  0 siblings, 90 replies; 95+ messages in thread
From: Sasha Levin @ 2016-03-13 17:52 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Nicholas Bellinger, Sagi Grimberg, Sasha Levin

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

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit ca82c2bded29b38d36140bfa1e76a7bbfcade390 ]

This patch addresses a case where iscsi_target_do_tx_login_io()
fails sending the last login response PDU, after the RX/TX
threads have already been started.

The case centers around iscsi_target_rx_thread() not invoking
allow_signal(SIGINT) before the send_sig(SIGINT, ...) occurs
from the failure path, resulting in RX thread hanging
indefinately on iscsi_conn->rx_login_comp.

Note this bug is a regression introduced by:

  commit e54198657b65625085834847ab6271087323ffea
  Author: Nicholas Bellinger <nab@linux-iscsi.org>
  Date:   Wed Jul 22 23:14:19 2015 -0700

      iscsi-target: Fix iscsit_start_kthreads failure OOPs

To address this bug, complete ->rx_login_complete for good
measure in the failure path, and immediately return from
RX thread context if connection state did not actually reach
full feature phase (TARG_CONN_STATE_LOGGED_IN).

Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: <stable@vger.kernel.org> # v3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/target/iscsi/iscsi_target.c      | 13 ++++++++++++-
 drivers/target/iscsi/iscsi_target_nego.c |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 958c732..0b1fdfe 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4054,6 +4054,17 @@ reject:
 	return iscsit_add_reject(conn, ISCSI_REASON_BOOKMARK_NO_RESOURCES, buf);
 }
 
+static bool iscsi_target_check_conn_state(struct iscsi_conn *conn)
+{
+	bool ret;
+
+	spin_lock_bh(&conn->state_lock);
+	ret = (conn->conn_state != TARG_CONN_STATE_LOGGED_IN);
+	spin_unlock_bh(&conn->state_lock);
+
+	return ret;
+}
+
 int iscsi_target_rx_thread(void *arg)
 {
 	int ret, rc;
@@ -4071,7 +4082,7 @@ int iscsi_target_rx_thread(void *arg)
 	 * incoming iscsi/tcp socket I/O, and/or failing the connection.
 	 */
 	rc = wait_for_completion_interruptible(&conn->rx_login_comp);
-	if (rc < 0)
+	if (rc < 0 || iscsi_target_check_conn_state(conn))
 		return 0;
 
 	if (conn->conn_transport->transport_type == ISCSI_INFINIBAND) {
diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c
index 092112e..dcb6348 100644
--- a/drivers/target/iscsi/iscsi_target_nego.c
+++ b/drivers/target/iscsi/iscsi_target_nego.c
@@ -393,6 +393,7 @@ err:
 	if (login->login_complete) {
 		if (conn->rx_thread && conn->rx_thread_active) {
 			send_sig(SIGINT, conn->rx_thread, 1);
+			complete(&conn->rx_login_comp);
 			kthread_stop(conn->rx_thread);
 		}
 		if (conn->tx_thread && conn->tx_thread_active) {
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 95+ messages in thread

end of thread, other threads:[~2016-03-15  3:57 UTC | newest]

Thread overview: 95+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-13 17:52 [added to the 3.18 stable tree] iscsi-target: Fix rx_login_comp hang after login failure Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] target: Fix race for SCF_COMPARE_AND_WRITE_POST checking Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] target: fix COMPARE_AND_WRITE non zero SGL offset data corruption Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] target: Fix LUN_RESET active I/O handling for ACK_KREF Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] target: Fix TAS handling for multi-session se_node_acls Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] target: Fix remote-port TMR ABORT + se_cmd fabric stop Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] target: Fix race with SCF_SEND_DELAYED_TAS handling Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] x86/entry/compat: Add missing CLAC to entry_INT80_32 Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] xen/scsiback: correct frontend counting Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] nfs: fix nfs_size_to_loff_t Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] libata: fix HDIO_GET_32BIT ioctl Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] iwlwifi: mvm: don't allow sched scans without matches to be started Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] xen/pciback: Save xen_pci_op commands before processing it Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] xen/pciback: Return error on XEN_PCI_OP_enable_msix when device has MSI or MSI-X enabled Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] xen/pciback: Don't allow MSI-X ops if PCI_COMMAND_MEMORY is not set Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] xen/pcifront: Fix mysterious crashes when NUMA locality information was extracted Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] [media] adv7604: fix tx 5v detect regression Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] usb: dwc3: Fix assignment of EP transfer resources Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] NFSv4: Fix a dentry leak on alias use Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] USB: option: add support for SIM7100E Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] USB: cp210x: add ID for ELV Marble Sound Board 1 Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] USB: cp210x: add IDs for GE B650V3 and B850V3 boards Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] usb: cp210x support SEL C662 Vendor/Device Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] USB: option: add "4G LTE usb-modem U901" Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] ahci: Order SATA device IDs for codename Lewisburg Sasha Levin
2016-03-13 17:52 ` [added to the 3.18 stable tree] Adding Intel Lewisburg device IDs for SATA Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] hwmon: (ads1015) Handle negative conversion values correctly Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] can: ems_usb: Fix possible tx overflow Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] s390/compat: correct restore of high gprs on signal return Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] drm/radeon/pm: adjust display configuration after powerstate Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] sunrpc/cache: fix off-by-one in qword_get() Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] KVM: arm/arm64: vgic: Ensure bitmaps are long enough Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] KVM: async_pf: do not warn on page allocation failures Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] tracing: Fix showing function event in available_events Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] libceph: don't bail early from try_read() when skipping a message Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] usb: chipidea: otg: change workqueue ci_otg as freezable Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda/realtek - Clean up mute/mic GPIO LED handling Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda/realtek - Supported HP mute Led for ALC286 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda - Enable mic mute hotkey and LEDs for an HP machine Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda - Enable docking station " Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda/realtek - Support Dell headset mode for ALC288 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda/realtek - Support Dell headset mode for ALC298 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda/realtek - Dell XPS one ALC3260 speaker no sound after resume back Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda - Fix headphone noise after Dell XPS 13 resume back from S3 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda - Fixing speaker noise on the two latest thinkpad models Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda - Add mic mute hotkey quirk for Lenovo ThinkCentre AIO Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] KVM: x86: MMU: fix ubsan index-out-of-range warning Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] Revert "jffs2: Fix lock acquisition order bug in jffs2_write_begin" Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] jffs2: Fix page lock / f->sem deadlock Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] Fix directory hardlinks from deleted directories Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda - Fixing background noise on Dell Inspiron 3162 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda/realtek - Support Dell headset mode for ALC225 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda - Fixup speaker pass-through control for nid 0x14 on ALC225 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda - Fix headset support and noise on HP EliteBook 755 G2 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] iommu/amd: Fix boot warning when device 00:00.0 is not iommu covered Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] iommu/amd: Apply workaround for ATS write permission check Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] libata: Align ata_device's id on a cacheline Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] mm: thp: fix SMP race condition between THP page fault and MADV_DONTNEED Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] hpfs: don't truncate the file when delete fails Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] do_last(): don't let a bogus return value from ->open() et.al. to confuse us Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] vfio: fix ioctl error handling Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: ctl: Fix ioctls for X32 ABI Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: rawmidi: Fix ioctls " Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: timer: Fix broken compat timer user status ioctl Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: timer: Fix ioctls for X32 ABI Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] cifs: fix out-of-bounds access in lease parsing Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] CIFS: Fix SMB2+ interim response processing for read requests Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] Fix cifs_uniqueid_to_ino_t() function for s390x Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] arm/arm64: KVM: Fix ioctl error handling Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hdspm: Fix wrong boolean ctl value accesses Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hdspm: Fix zero-division Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hdsp: Fix wrong boolean ctl value accesses Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] USB: qcserial: add Dell Wireless 5809e Gobi 4G HSPA+ (rev3) Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] USB: cp210x: Add ID for Parrot NMEA GPS Flight Recorder Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] USB: serial: option: add support for Telit LE922 PID 0x1045 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] USB: serial: option: add support for Quectel UC20 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: usb-audio: Add a quirk for Plantronics DA45 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: seq: oss: Don't drain at closing a client Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] drm/ast: Fix incorrect register check for DRAM width Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] USB: qcserial: add Sierra Wireless MC74xx/EM74xx Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] USB: qcserial: add Sierra Wireless EM74xx device ID Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] drm/radeon/pm: update current crtc info after setting the powerstate Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] PM / sleep / x86: Fix crash on graph trace through x86 suspend Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] ALSA: hda - Fix mic issues on Acer Aspire E1-472 Sasha Levin
2016-03-13 17:53 ` [added to the 3.18 stable tree] block: bio: introduce helpers to get the 1st and last bvec Sasha Levin
2016-03-14 14:52   ` Jens Axboe
2016-03-14 16:37     ` Sasha Levin
2016-03-14 16:40       ` Jens Axboe
2016-03-15  3:57         ` Ming Lei
2016-03-13 17:53 ` [added to the 3.18 stable tree] MIPS: traps: Fix SIGFPE information leak from `do_ov' and `do_trap_or_bp' Sasha Levin
2016-03-13 17:54 ` [added to the 3.18 stable tree] ubi: Fix out of bounds write in volume update code Sasha Levin
2016-03-13 17:54 ` [added to the 3.18 stable tree] iwlwifi: pcie: support loading FW with extended mem range Sasha Levin
2016-03-13 17:54 ` [added to the 3.18 stable tree] HID: usbhid: fix recursive deadlock Sasha Levin
2016-03-13 17:54 ` [added to the 3.18 stable tree] tools: Add a "make all" rule Sasha Levin
2016-03-13 17:54 ` [added to the 3.18 stable tree] KVM: x86: move steal time initialization to vcpu entry time Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox