stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Stefan Haberland <sth@linux.vnet.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL for 4.4 15/36] s390/dasd: prevent prefix I/O error
Date: Sun, 28 Jan 2018 22:28:33 +0000	[thread overview]
Message-ID: <20180128222815.29479-15-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180128222815.29479-1-alexander.levin@microsoft.com>

From: Stefan Haberland <sth@linux.vnet.ibm.com>

[ Upstream commit da340f921d3454f1521671c7a5a43ad3331fbe50 ]

Prevent that a prefix flag is set based on invalid configuration data.
The validity.verify_base flag should only be set for alias devices.
Usually the unit address type is either one of base, PAV alias or
HyperPAV alias. But in cases where the unit address type is not set or
any other value the validity.verify_base flag might be set as well.
This would lead to follow on errors.
Explicitly check for alias devices and set the validity flag only for
them.

Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/s390/block/dasd_eckd.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 9083247f55a8..21d174e9ebdb 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -518,10 +518,12 @@ static int prefix_LRE(struct ccw1 *ccw, struct PFX_eckd_data *pfxdata,
 	pfxdata->validity.define_extent = 1;
 
 	/* private uid is kept up to date, conf_data may be outdated */
-	if (startpriv->uid.type != UA_BASE_DEVICE) {
+	if (startpriv->uid.type == UA_BASE_PAV_ALIAS)
 		pfxdata->validity.verify_base = 1;
-		if (startpriv->uid.type == UA_HYPER_PAV_ALIAS)
-			pfxdata->validity.hyper_pav = 1;
+
+	if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) {
+		pfxdata->validity.verify_base = 1;
+		pfxdata->validity.hyper_pav = 1;
 	}
 
 	/* define extend data (mostly)*/
@@ -3002,10 +3004,12 @@ static int prepare_itcw(struct itcw *itcw,
 	pfxdata.validity.define_extent = 1;
 
 	/* private uid is kept up to date, conf_data may be outdated */
-	if (startpriv->uid.type != UA_BASE_DEVICE) {
+	if (startpriv->uid.type == UA_BASE_PAV_ALIAS)
+		pfxdata.validity.verify_base = 1;
+
+	if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) {
 		pfxdata.validity.verify_base = 1;
-		if (startpriv->uid.type == UA_HYPER_PAV_ALIAS)
-			pfxdata.validity.hyper_pav = 1;
+		pfxdata.validity.hyper_pav = 1;
 	}
 
 	switch (cmd) {
-- 
2.11.0

  parent reply	other threads:[~2018-01-28 22:29 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-28 22:28 [PATCH AUTOSEL for 4.4 01/36] usb: build drivers/usb/common/ when USB_SUPPORT is set Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 02/36] ARM: OMAP2+: Fix SRAM virt to phys translation for save_secure_ram_context Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 03/36] ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 04/36] ARM: dts: Fix omap4 hang with GPS connected to USB by using wakeupgen Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 05/36] ARM: dts: am4372: Correct the interrupts_properties of McASP Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 07/36] perf bench numa: Fixup discontiguous/sparse numa nodes Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 06/36] perf top: Fix window dimensions change handling Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 08/36] media: s5k6aa: describe some function parameters Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 09/36] pinctrl: sunxi: Fix A80 interrupt pin bank Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 10/36] RDMA/cma: Make sure that PSN is not over max allowed Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 11/36] scripts/kernel-doc: Don't fail with status != 0 if error encountered with -none Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 13/36] m68k: add missing SOFTIRQENTRY_TEXT linker section Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 12/36] ipvlan: Add the skb->mark as flow4's member to lookup route Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 14/36] powerpc/perf: Fix oops when grouping different pmu events Sasha Levin
2018-01-28 22:28 ` Sasha Levin [this message]
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 17/36] net_sched: red: Avoid devision by zero Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 16/36] gianfar: fix a flooded alignment reports because of padding issue Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 18/36] net_sched: red: Avoid illegal values Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 19/36] dccp: CVE-2017-8824: use-after-free in DCCP code Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 20/36] btrfs: Fix possible off-by-one in btrfs_search_path_in_tree Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 21/36] 509: fix printing uninitialized stack memory when OID is empty Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 22/36] dmaengine: ioat: Fix error handling path Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 23/36] dmaengine: at_hdmac: fix potential NULL pointer dereference in atc_prep_dma_interleaved Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 24/36] xfrm: Fix stack-out-of-bounds read on socket policy lookup Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 26/36] clk: fix a panic error caused by accessing NULL pointer Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 25/36] netfilter: nfnetlink_cthelper: Add missing permission checks Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 27/36] netfilter: xt_osf: " Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 28/36] ASoC: rockchip: disable clock on error Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 29/36] spi: sun4i: disable clocks in the remove function Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 30/36] xfrm: Fix stack-out-of-bounds with misconfigured transport mode policies Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 31/36] drm/armada: fix leak of crtc structure Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 32/36] dmaengine: jz4740: disable/unprepare clk if probe fails Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 34/36] x86/mm/kmmio: Fix mmiotrace for page unaligned addresses Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 35/36] xen: XEN_ACPI_PROCESSOR is Dom0-only Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.4 36/36] hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close Sasha Levin

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=20180128222815.29479-15-alexander.levin@microsoft.com \
    --to=alexander.levin@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=sth@linux.vnet.ibm.com \
    /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).