All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Gavin Guo <gavin.guo@canonical.com>,
	Moussa Ba <moussaba@micron.com>,
	Nicholas Bellinger <nab@linux-iscsi.org>
Subject: [PATCH 3.10 28/53] iscsi-target: Drop problematic active_ts_list usage
Date: Tue,  3 Mar 2015 22:06:31 -0800	[thread overview]
Message-ID: <20150304054614.654648619@linuxfoundation.org> (raw)
In-Reply-To: <20150304054609.869052846@linuxfoundation.org>

3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

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

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->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->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]  [<ffffffff81553ae7>] dump_stack+0x49/0x62
[   60.782615]  [<ffffffff8104d1cc>] warn_slowpath_common+0x8c/0xc0
[   60.782618]  [<ffffffff8104d2b6>] warn_slowpath_fmt+0x46/0x50
[   60.782620]  [<ffffffff81280933>] __list_del_entry+0x63/0xd0
[   60.782622]  [<ffffffff812809b1>] list_del+0x11/0x40
[   60.782630]  [<ffffffffa06e7cf9>] iscsi_del_ts_from_active_list+0x29/0x50 [iscsi_target_mod]
[   60.782635]  [<ffffffffa06e87b1>] iscsi_tx_thread_pre_handler+0xa1/0x180 [iscsi_target_mod]
[   60.782642]  [<ffffffffa06fb9ae>] iscsi_target_tx_thread+0x4e/0x220 [iscsi_target_mod]
[   60.782647]  [<ffffffffa06fb960>] ? iscsit_handle_snack+0x190/0x190 [iscsi_target_mod]
[   60.782652]  [<ffffffffa06fb960>] ? iscsit_handle_snack+0x190/0x190 [iscsi_target_mod]
[   60.782655]  [<ffffffff8106f99e>] kthread+0xce/0xe0
[   60.782657]  [<ffffffff8106f8d0>] ? kthread_freezable_should_stop+0x70/0x70
[   60.782660]  [<ffffffff8156026c>] ret_from_fork+0x7c/0xb0
[   60.782662]  [<ffffffff8106f8d0>] ? 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 <gavin.guo@canonical.com>
Reported-by: Moussa Ba <moussaba@micron.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/target/iscsi/iscsi_target_tq.c |   28 +++++-----------------------
 1 file changed, 5 insertions(+), 23 deletions(-)

--- a/drivers/target/iscsi/iscsi_target_tq.c
+++ b/drivers/target/iscsi/iscsi_target_tq.c
@@ -26,36 +26,22 @@
 #include "iscsi_target_tq.h"
 #include "iscsi_target.h"
 
-static LIST_HEAD(active_ts_list);
 static LIST_HEAD(inactive_ts_list);
-static DEFINE_SPINLOCK(active_ts_lock);
 static DEFINE_SPINLOCK(inactive_ts_lock);
 static DEFINE_SPINLOCK(ts_bitmap_lock);
 
-static void iscsi_add_ts_to_active_list(struct iscsi_thread_set *ts)
-{
-	spin_lock(&active_ts_lock);
-	list_add_tail(&ts->ts_list, &active_ts_list);
-	iscsit_global->active_ts++;
-	spin_unlock(&active_ts_lock);
-}
-
 static void iscsi_add_ts_to_inactive_list(struct iscsi_thread_set *ts)
 {
+	if (!list_empty(&ts->ts_list)) {
+		WARN_ON(1);
+		return;
+	}
 	spin_lock(&inactive_ts_lock);
 	list_add_tail(&ts->ts_list, &inactive_ts_list);
 	iscsit_global->inactive_ts++;
 	spin_unlock(&inactive_ts_lock);
 }
 
-static void iscsi_del_ts_from_active_list(struct iscsi_thread_set *ts)
-{
-	spin_lock(&active_ts_lock);
-	list_del(&ts->ts_list);
-	iscsit_global->active_ts--;
-	spin_unlock(&active_ts_lock);
-}
-
 static struct iscsi_thread_set *iscsi_get_ts_from_inactive_list(void)
 {
 	struct iscsi_thread_set *ts;
@@ -68,7 +54,7 @@ static struct iscsi_thread_set *iscsi_ge
 
 	ts = list_first_entry(&inactive_ts_list, struct iscsi_thread_set, ts_list);
 
-	list_del(&ts->ts_list);
+	list_del_init(&ts->ts_list);
 	iscsit_global->inactive_ts--;
 	spin_unlock(&inactive_ts_lock);
 
@@ -219,8 +205,6 @@ static void iscsi_deallocate_extra_threa
 
 void iscsi_activate_thread_set(struct iscsi_conn *conn, struct iscsi_thread_set *ts)
 {
-	iscsi_add_ts_to_active_list(ts);
-
 	spin_lock_bh(&ts->ts_state_lock);
 	conn->thread_set = ts;
 	ts->conn = conn;
@@ -423,7 +407,6 @@ struct iscsi_conn *iscsi_rx_thread_pre_h
 
 	if (ts->delay_inactive && (--ts->thread_count == 0)) {
 		spin_unlock_bh(&ts->ts_state_lock);
-		iscsi_del_ts_from_active_list(ts);
 
 		if (!iscsit_global->in_shutdown)
 			iscsi_deallocate_extra_thread_sets();
@@ -476,7 +459,6 @@ struct iscsi_conn *iscsi_tx_thread_pre_h
 
 	if (ts->delay_inactive && (--ts->thread_count == 0)) {
 		spin_unlock_bh(&ts->ts_state_lock);
-		iscsi_del_ts_from_active_list(ts);
 
 		if (!iscsit_global->in_shutdown)
 			iscsi_deallocate_extra_thread_sets();



  parent reply	other threads:[~2015-03-04  6:14 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04  6:06 [PATCH 3.10 00/53] 3.10.71-stable review Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 01/53] Bluetooth: ath3k: workaround the compatibility issue with xHCI controller Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 02/53] xfs: ensure buffer types are set correctly Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 03/53] xfs: inode unlink does not set AGI buffer type Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 04/53] xfs: set superblock buffer type correctly Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 05/53] fsnotify: fix handling of renames in audit Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 06/53] iwlwifi: pcie: disable the SCD_BASE_ADDR when we resume from WoWLAN Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 07/53] iwlwifi: mvm: validate tid and sta_id in ba_notif Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 08/53] iwlwifi: mvm: fix failure path when power_update fails in add_interface Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 09/53] iwlwifi: mvm: always use mac color zero Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 10/53] HID: i2c-hid: Limit reads to wMaxInputLength bytes for input events Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 11/53] PCI: Generate uppercase hex for modalias var in uevent Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 14/53] [media] lmedm04: Fix usb_submit_urb BOGUS urb xfer, pipe 1 != type 3 in interrupt urb Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 15/53] ALSA: off by one bug in snd_riptide_joystick_probe() Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 16/53] ALSA: hdspm - Constrain periods to 2 on older cards Greg Kroah-Hartman
2015-03-04 10:03   ` Adrian Knoth
2015-03-04 18:19     ` Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 17/53] power_supply: 88pm860x: Fix leaked power supply on probe fail Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 18/53] mmc: sdhci-pxav3: fix setting of pdata->clk_delay_cycles Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 19/53] nfs: dont call blocking operations while !TASK_RUNNING Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 20/53] MIPS: KVM: Deliver guest interrupts after local_irq_disable() Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 21/53] tracing: Fix unmapping loop in tracing_mark_write Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 22/53] ARM: 8284/1: sa1100: clear RCSR_SMR on resume Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 23/53] tpm_tis: verify interrupt during init Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 24/53] tpm: Fix NULL return in tpm_ibmvtpm_get_desired_dma Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 25/53] tpm/tpm_i2c_stm_st33: Fix potential bug in tpm_stm_i2c_send Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 26/53] Added Little Endian support to vtpm module Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 27/53] NFSv4.1: Fix a kfree() of uninitialised pointers in decode_cb_sequence_args Greg Kroah-Hartman
2015-03-04  6:06 ` Greg Kroah-Hartman [this message]
2015-03-04  6:06 ` [PATCH 3.10 29/53] cfq-iosched: handle failure of cfq group allocation Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 30/53] cfq-iosched: fix incorrect filing of rt async cfqq Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 31/53] axonram: Fix bug in direct_access Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 32/53] tty: Prevent untrappable signals from malicious program Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 33/53] USB: cp210x: add ID for RUGGEDCOM USB Serial Console Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 34/53] USB: fix use-after-free bug in usb_hcd_unlink_urb() Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 35/53] usb: core: buffer: smallest buffer should start at ARCH_DMA_MINALIGN Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 36/53] vt: provide notifications on selection changes Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 37/53] ARM: pxa: add regulator_has_full_constraints to corgi board file Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 38/53] ARM: pxa: add regulator_has_full_constraints to poodle " Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 39/53] kdb: fix incorrect counts in KDB summary command output Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 40/53] ntp: Fixup adjtimex freq validation on 32-bit systems Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 41/53] ARC: fix page address calculation if PAGE_OFFSET != LINUX_LINK_BASE Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 42/53] KVM: s390: floating irqs: fix user triggerable endless loop Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 43/53] KVM: MIPS: Dont leak FPU/DSP to guest Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 44/53] KVM: x86: update masterclock values on TSC writes Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 45/53] hx4700: regulator: declare full constraints Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 46/53] arm64: compat Fix siginfo_t -> compat_siginfo_t conversion on big endian Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 47/53] gpio: tps65912: fix wrong container_of arguments Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 48/53] metag: Fix KSTK_EIP() and KSTK_ESP() macros Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 49/53] md/raid5: Fix livelock when array is both resyncing and degraded Greg Kroah-Hartman
2015-03-04 14:09   ` Jes Sorensen
2015-03-04  6:06 ` [PATCH 3.10 51/53] jffs2: fix handling of corrupted summary length Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 52/53] blk-throttle: check stats_cpu before reading it from sysfs Greg Kroah-Hartman
2015-03-04  6:06 ` [PATCH 3.10 53/53] x86, mm/ASLR: Fix stack randomization on 64-bit systems Greg Kroah-Hartman
2015-03-04 14:08 ` [PATCH 3.10 00/53] 3.10.71-stable review Guenter Roeck
2015-03-04 14:20   ` Luis Henriques
2015-03-04 14:20     ` Luis Henriques
2015-03-04 18:16     ` Greg Kroah-Hartman
2015-03-04 23:40 ` Shuah Khan

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=20150304054614.654648619@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=gavin.guo@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moussaba@micron.com \
    --cc=nab@linux-iscsi.org \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.