stable.vger.kernel.org archive mirror
 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, Sebastian Ott <sebott@linux.vnet.ibm.com>,
	Peter Oberparleiter <oberpar@linux.vnet.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [PATCH 4.8 083/125] s390/cio: fix accidental interrupt enabling during resume
Date: Sat, 29 Oct 2016 09:50:01 -0400	[thread overview]
Message-ID: <20161029134950.624314210@linuxfoundation.org> (raw)
In-Reply-To: <20161029134947.232372651@linuxfoundation.org>

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

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

From: Sebastian Ott <sebott@linux.vnet.ibm.com>

commit d53c51f26145657aa7c55fa396f93677e613548d upstream.

Since commit 9f3d6d7 chsc_get_channel_measurement_chars is called with
interrupts disabled during resume from hibernate. Since this function
used spin_unlock_irq, interrupts have been enabled accidentally. Fix
this by using the irqsave variant.

Since we can't guarantee the IRQ-enablement state for all (future/
external) callers, change the locking in related functions to prevent
similar bugs in the future.

Fixes: 9f3d6d7 ("s390/cio: update measurement characteristics")
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/s390/cio/chsc.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -95,12 +95,13 @@ struct chsc_ssd_area {
 int chsc_get_ssd_info(struct subchannel_id schid, struct chsc_ssd_info *ssd)
 {
 	struct chsc_ssd_area *ssd_area;
+	unsigned long flags;
 	int ccode;
 	int ret;
 	int i;
 	int mask;
 
-	spin_lock_irq(&chsc_page_lock);
+	spin_lock_irqsave(&chsc_page_lock, flags);
 	memset(chsc_page, 0, PAGE_SIZE);
 	ssd_area = chsc_page;
 	ssd_area->request.length = 0x0010;
@@ -144,7 +145,7 @@ int chsc_get_ssd_info(struct subchannel_
 			ssd->fla[i] = ssd_area->fla[i];
 	}
 out:
-	spin_unlock_irq(&chsc_page_lock);
+	spin_unlock_irqrestore(&chsc_page_lock, flags);
 	return ret;
 }
 
@@ -832,9 +833,10 @@ int __chsc_do_secm(struct channel_subsys
 		u32 fmt : 4;
 		u32 : 16;
 	} __attribute__ ((packed)) *secm_area;
+	unsigned long flags;
 	int ret, ccode;
 
-	spin_lock_irq(&chsc_page_lock);
+	spin_lock_irqsave(&chsc_page_lock, flags);
 	memset(chsc_page, 0, PAGE_SIZE);
 	secm_area = chsc_page;
 	secm_area->request.length = 0x0050;
@@ -864,7 +866,7 @@ int __chsc_do_secm(struct channel_subsys
 		CIO_CRW_EVENT(2, "chsc: secm failed (rc=%04x)\n",
 			      secm_area->response.code);
 out:
-	spin_unlock_irq(&chsc_page_lock);
+	spin_unlock_irqrestore(&chsc_page_lock, flags);
 	return ret;
 }
 
@@ -992,6 +994,7 @@ chsc_initialize_cmg_chars(struct channel
 
 int chsc_get_channel_measurement_chars(struct channel_path *chp)
 {
+	unsigned long flags;
 	int ccode, ret;
 
 	struct {
@@ -1021,7 +1024,7 @@ int chsc_get_channel_measurement_chars(s
 	if (!css_chsc_characteristics.scmc || !css_chsc_characteristics.secm)
 		return -EINVAL;
 
-	spin_lock_irq(&chsc_page_lock);
+	spin_lock_irqsave(&chsc_page_lock, flags);
 	memset(chsc_page, 0, PAGE_SIZE);
 	scmc_area = chsc_page;
 	scmc_area->request.length = 0x0010;
@@ -1053,7 +1056,7 @@ int chsc_get_channel_measurement_chars(s
 	chsc_initialize_cmg_chars(chp, scmc_area->cmcv,
 				  (struct cmg_chars *) &scmc_area->data);
 out:
-	spin_unlock_irq(&chsc_page_lock);
+	spin_unlock_irqrestore(&chsc_page_lock, flags);
 	return ret;
 }
 
@@ -1134,6 +1137,7 @@ struct css_chsc_char css_chsc_characteri
 int __init
 chsc_determine_css_characteristics(void)
 {
+	unsigned long flags;
 	int result;
 	struct {
 		struct chsc_header request;
@@ -1146,7 +1150,7 @@ chsc_determine_css_characteristics(void)
 		u32 chsc_char[508];
 	} __attribute__ ((packed)) *scsc_area;
 
-	spin_lock_irq(&chsc_page_lock);
+	spin_lock_irqsave(&chsc_page_lock, flags);
 	memset(chsc_page, 0, PAGE_SIZE);
 	scsc_area = chsc_page;
 	scsc_area->request.length = 0x0010;
@@ -1168,7 +1172,7 @@ chsc_determine_css_characteristics(void)
 		CIO_CRW_EVENT(2, "chsc: scsc failed (rc=%04x)\n",
 			      scsc_area->response.code);
 exit:
-	spin_unlock_irq(&chsc_page_lock);
+	spin_unlock_irqrestore(&chsc_page_lock, flags);
 	return result;
 }
 



  parent reply	other threads:[~2016-10-29 13:54 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161029135133uscas1p244a56d26b4705445442b5e2e8454ba28@uscas1p2.samsung.com>
2016-10-29 13:48 ` [PATCH 4.8 000/125] 4.8.6-stable review Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 001/125] drm/vc4: Fix races when the CS reads from render targets Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 005/125] drm/amdgpu: fix IB alignment for UVD Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 006/125] drm/amdgpu/dce10: disable hpd on local panels Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 007/125] drm/amdgpu/dce8: " Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 008/125] drm/amdgpu/dce11: " Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 009/125] drm/amdgpu/dce11: add missing drm_mode_config_cleanup call Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 011/125] drm/amdgpu: change vblank_times calculation method to reduce computational error Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 012/125] drm/radeon: narrow asic_init for virtualization Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 013/125] drm/radeon/si/dpm: fix phase shedding setup Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 014/125] drm/radeon: change vblank_times calculation method to reduce computational error Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 015/125] drm/vmwgfx: Limit the user-space command buffer size Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 016/125] drm/fsl-dcu: fix endian issue when using clk_register_divider Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 017/125] drm/amd/powerplay: fix mclk not switching back after multi-head was disabled Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 018/125] HID: add quirk for Akai MIDImix Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 022/125] drm/i915/skl: Dont try to update plane watermarks if they havent changed Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 023/125] drm/i915/gen9: only add the planes actually affected by ddb changes Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 024/125] drm/i915/gen9: fix the WaWmMemoryReadLatency implementation Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 025/125] drm/i915/gen9: minimum scanlines for Y tile is not always 4 Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 026/125] drm/i915/gen9: fix plane_blocks_per_line on watermarks calculations Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 027/125] drm/i915/gen9: fix the watermark res_blocks value Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 028/125] drm/i915: SAGV is not SKL-only, so rename a few things Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 029/125] drm/i915: introduce intel_has_sagv() Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 030/125] drm/i915/kbl: KBL also needs to run the SAGV code Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 031/125] Revert "drm/i915: Check live status before reading edid" Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 037/125] drm/i915: Just clear the mmiodebug before a register access Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 038/125] drm/i915: Unalias obj->phys_handle and obj->userptr Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 039/125] posix_acl: Clear SGID bit when setting file permissions Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 040/125] rt2x00usb: Fix error return code Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 041/125] scsi: cxlflash: Remove the device cleanly in the system shutdown path Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 042/125] genirq/generic_chip: Add irq_unmap callback Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 043/125] coresight: Remove erroneous dma_free_coherent in tmc_probe Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 044/125] uio: fix dmem_region_start computation Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 046/125] spi: spi-fsl-dspi: Drop extra spi_master_put in device remove function Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 047/125] i40e: remove a stray unlock Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 048/125] i40e: fix broken i40e_config_rss_aq function Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 049/125] mwifiex: correct aid value during tdls setup Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 050/125] mwifiex: fix failed to reconnect after interface disabled/enabled Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 051/125] ath10k: Add WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT wmi service Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 052/125] ath10k: fix sending frame in management path in push txq logic Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 053/125] ath10k: fix reporting channel survey data Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 054/125] ath10k: fix throughput regression in multi client mode Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 055/125] crypto: marvell - Dont overwrite default creq->state during initialization Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 057/125] crypto: marvell - Update transformation context for each dequeued req Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 058/125] crypto: arm/ghash-ce - add missing async import/export Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 059/125] crypto: ccp - Fix return value check in ccp_dmaengine_register() Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 060/125] hwrng: omap - Only fail if pm_runtime_get_sync returns < 0 Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 061/125] ASoC: topology: Fix error return code in soc_tplg_dapm_widget_create() Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 062/125] ASoC: dapm: Fix possible uninitialized variable in snd_soc_dapm_get_volsw() Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 063/125] ASoC: dapm: Fix value setting for _ENUM_DOUBLE MUXs second channel Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 064/125] ASoC: dapm: Fix kcontrol creation for output driver widget Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 065/125] ASoC: sst-bxt-rt298: fix obsoleted initializers for array Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 066/125] ASoC: sst-bxt-da7219_max98357a: " Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 067/125] iio: ad5755: fix off-by-one on devnr limit check Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 068/125] iio: light: us5182d: Add missing error code assignment before test Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 069/125] staging: android ion/hisi: fix dependencies Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 070/125] staging: sm750fb: Correctly set CLOCK_PHASE bit of display controller Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 071/125] staging: r8188eu: Fix scheduling while atomic splat Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 072/125] staging: ks7010: fix wait_for_completion_interruptible_timeout return handling Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 073/125] staging: ks7010: declare private functions static Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 074/125] IB/hfi1: Move iowait_init() to priv allocate Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 075/125] IB/rdmavt: Correct sparse annotation Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 076/125] IB/qib: Remove qpt_mask global Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 077/125] IB/mlx5: Fix steering resource leak Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 078/125] power: bq24257: Fix use of uninitialized pointer bq->charger Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 079/125] dmaengine: ipu: remove bogus NO_IRQ reference Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 080/125] mm/hugetlb: check for reserved hugepages during memory offline Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 081/125] mm/hugetlb: improve locking in dissolve_free_huge_pages() Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 082/125] drm/vmwgfx: Avoid validating views on view destruction Greg Kroah-Hartman
2016-10-29 13:50   ` Greg Kroah-Hartman [this message]
2016-10-29 13:50   ` [PATCH 4.8 084/125] s390/con3270: fix use of uninitialised data Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 085/125] s390/con3270: fix insufficient space padding Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 086/125] clk: bcm2835: Skip PLLC clocks when deciding on a new clock parent Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 087/125] clk: gcc-msm8996: Fix pcie 2 pipe register offset Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 088/125] clk: qcom: select GDSC for msm8996 gcc and mmcc Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 089/125] clk: qoriq: fix a register offset error Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 090/125] clk: Return errors from clk providers in __of_clk_get_from_provider() Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 091/125] clk: core: Force setting the phase delay when no change Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 092/125] clk: divider: Fix clk_divider_round_rate() to use clk_readl() Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 093/125] perf data: Fix building in 32 bit platform with libbabeltrace Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 094/125] perf hists browser: Fix event group display Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 095/125] perf powerpc: Fix build-test failure Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 097/125] perf ui/stdio: Always reset output width for hierarchy Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 098/125] perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 099/125] perf symbols: Fixup symbol sizes before picking best ones Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 100/125] iwlwifi: check for valid ethernet address provided by OEM Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 101/125] iwlwifi: mvm: fix pending frames tracking on tx resp Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 102/125] iwlwifi: mvm: call a different txq_enable function Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 103/125] iwlwifi: mvm: free reserved queue on STA removal Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 104/125] iwlwifi: mvm: support BAR in reorder buffer Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 105/125] iwlwifi: mvm: disable P2P queue on mac context release Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 106/125] iwlwifi: mvm: bail out if CTDP start operation fails Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 107/125] ARM: dts: sun9i: Add missing #interrupt-cells to R_PIO pinctrl device node Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 108/125] pinctrl: qcom: fix masking of pinmux functions Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 109/125] mpt3sas: Dont spam logs if logging level is 0 Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 110/125] powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 111/125] powerpc: Add check_if_tm_restore_required() to giveup_all() Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 112/125] powerpc/nvram: Fix an incorrect partition merge Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 113/125] powerpc: Fix usage of _PAGE_RO in hugepage Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 114/125] ARM: pxa: pxa_cplds: fix interrupt handling Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 115/125] ARM: pxa: fix GPIO double shifts Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 116/125] ARM: dts: NSP: Correct RAM amount for BCM958625HR board Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 117/125] ARM: dts: fix RealView EB SMSC ethernet version Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 118/125] ARM: dts: omap3: overo: add missing unit name for lcd35 display Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 119/125] PCI: rcar: Fix pci_remap_iospace() failure path Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 120/125] PCI: aardvark: " Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 121/125] PCI: generic: " Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 122/125] PCI: versatile: " Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 123/125] PCI: designware: " Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 124/125] PCI: tegra: " Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 125/125] libnvdimm: clear the internal poison_list when clearing badblocks Greg Kroah-Hartman
2016-10-29 23:07   ` [PATCH 4.8 000/125] 4.8.6-stable review Shuah Khan
2016-10-30 10:29     ` Greg Kroah-Hartman
2016-10-30  0:44   ` Guenter Roeck
2016-10-30 10:28     ` Greg Kroah-Hartman

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=20161029134950.624314210@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oberpar@linux.vnet.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.vnet.ibm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).