Received: by 10.223.185.116 with SMTP id b49csp1099601wrg; Fri, 23 Feb 2018 11:56:46 -0800 (PST) X-Google-Smtp-Source: AH8x22795EjTeh6ez6KObYJdeArpLA4X2B/Fm01PVp6W2rwIpSVyWFXmqTnMUje5kQFGQtP6cigv X-Received: by 10.98.110.71 with SMTP id j68mr1109780pfc.93.1519415806145; Fri, 23 Feb 2018 11:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519415806; cv=none; d=google.com; s=arc-20160816; b=wQUzCMpIbirFC4S++A5oKT5E8NaM5ibPD5eLzJEUTWcKH4sRPgMRlAlhNtBp35FQVz z3ZAV7PxThnSJiOSt+3m4UHx0ysLSSLiJK99t3KiXF4ymDc+Mb0azmYXLrrFqMFMfeXM IQizlaKbIi1bLjQ/iCbSUyIzcnKnJfZcAMqHK75vE2GMN935kr9X8KDRg0jvbe0p+Y7x rEXLVruRu8UOKuVNLM9Xy9Tc+W0CUl0ZdCBW1ws3Z4ExAhEFHT+CfRj2/DkpQUaAJjh/ 1Y8fd96zVY2YraeDnteJg6klf5HyhiY9Q1X7B3cBAXAArFXbwQKeC1EXRUdo2ox9gGOZ Bzdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=EUaTl+tA4OoF65ivQAYdbLkS1Tqn/hUjHDyq3WM7G8I=; b=ZgCItYOwFZ/wKx11XRnZbtPfyY6nwf9tFWrSIVdwK1SWlVT2FBsbMVkEO0Kk8nMVmq qfBDDIRIJ8z3+KHQe4mG8CwQkb/QQSMB+hZfXIClf/gnO72hY0Lowd/pLTIldQx/OrUG uRNyzy5yMyPIp8HQWrG1PCvIcGya3SqlV8ory7Go6B5GGeDrrlBv/dkPPm0R0F74dy/0 9e//ymWpcbUifKB/mddZIe7VLkguOrq7Pg7Y2O6+PjZ+xaMDGiiN6fSKdSF2yn+nY6KR YPxs0HfjOGFPXgxIYgdIHqc5jm5YAR/wHBcnGZCuCgcXkRosCC49kYhTSvyGZp25ch7r S3AQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g24si2287534pfe.107.2018.02.23.11.56.32; Fri, 23 Feb 2018 11:56:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933780AbeBWTzc (ORCPT + 99 others); Fri, 23 Feb 2018 14:55:32 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:43168 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933681AbeBWSo7 (ORCPT ); Fri, 23 Feb 2018 13:44:59 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E867B1244; Fri, 23 Feb 2018 18:44:53 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Haberland , Jan Hoeppner , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.9 062/145] s390/dasd: prevent prefix I/O error Date: Fri, 23 Feb 2018 19:26:08 +0100 Message-Id: <20180223170732.795025637@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170724.669759283@linuxfoundation.org> References: <20180223170724.669759283@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Haberland [ 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 Reviewed-by: Jan Hoeppner Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/s390/block/dasd_eckd.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -521,10 +521,12 @@ static int prefix_LRE(struct ccw1 *ccw, 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)*/ @@ -3471,10 +3473,12 @@ static int prepare_itcw(struct itcw *itc 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) {