Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5447533imm; Tue, 16 Oct 2018 10:21:31 -0700 (PDT) X-Google-Smtp-Source: ACcGV60QhxDNjZjgo9/kEK4qDmvQeC7n1qKswRV8KRPgyxo3E9tbuJlZWmr8oolDhgDacbl8CMYS X-Received: by 2002:a63:4c4e:: with SMTP id m14-v6mr21172646pgl.173.1539710491906; Tue, 16 Oct 2018 10:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539710491; cv=none; d=google.com; s=arc-20160816; b=msz3Im5mOu6URbbZkzDNZ8DNNsb6zaJfZGLQSlzNruCHvSL2rgtuGazzxPq140h6oy GDcVkf6cD7jJSdwAgX+t4wAcDKs2nsqsSIR8rz2NrhUjmfqqfkiUER2vyOaUT/PR2LJu Zjxyzth+kgGCAHfIhiHbaVrSfrOPG2BN0hzdzFcICZK3e4SFQ7EZmIAh486DCQxsY+YQ lF1VXqPsCnqwwXn5IiU7X4IlQizPwEgNjxfRLmGSQsDcwm8NvTDKTuLVGgR7ylHbDkMf 7EbVlLKqC4KUAfPh6HWFdpyvi+rwsLoIgxHDG5XGjSd4UMydLkSMd6y5j+dIKijjhMy4 uGwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZiE9H89f4IIeidGu54OD9xS/fJ+4Rl7DBfzymJsdV4k=; b=P4wf7HOrh+lmtukqLSHpdsdf62qkiFhS9p2XG7tr0x1V7DUtpdiE2Tn/fXxwJMjcgE OJlDGlV/cwJJoB2QRA1ib+H7urURsRCO34RB8Eq1XUInw3zdmic7pm4vQDYRHxQ7iiCY v11ocqtB5IzuRoY2Tg1/4iRDqSRlQ8Gq15ubKHG5if7FDBH88RrQ52ksPKyDcbjoegfo KvPOkGQZJvgfC/3Vop+/jqHa1P7Qtu4pb+u4FSxxliVq0Fvh9rNJb8uj411INHTI1TU9 HDMok+QMOxUHskbzm4il+t2s9+e8PH6Ur4fIMhbibjPEWw+EZvv2i9mKs/U8s07hpmrc WO0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="g/REjpon"; 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 h18-v6si14612124pgl.398.2018.10.16.10.21.15; Tue, 16 Oct 2018 10:21:31 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b="g/REjpon"; 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 S1730560AbeJQBLe (ORCPT + 99 others); Tue, 16 Oct 2018 21:11:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:56890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729271AbeJQBLd (ORCPT ); Tue, 16 Oct 2018 21:11:33 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0E8402089E; Tue, 16 Oct 2018 17:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539710408; bh=rVb49w8mTFrRaevMqfIWVHbkuTSfXtsOaaV1DCLH6WM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g/REjponUVXIzsbSNZb0xQWj8udvS4kra4crRTtHxaOhtYF2BMcMLSgU5+2eUwLVc qbm3/62HGlKMI+9H5E5cpmy3EJtr8kgL226w05jN4K2K0L7aXub7sFQ/HDJ/wUWoNG ej6CZjmvIoBeEocN9rCiYvSNQLqA/vLikjUWN7cY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Farman , Cornelia Huck Subject: [PATCH 4.14 067/109] s390/cio: Fix how vfio-ccw checks pinned pages Date: Tue, 16 Oct 2018 19:05:35 +0200 Message-Id: <20181016170528.477230719@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016170524.530541524@linuxfoundation.org> References: <20181016170524.530541524@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Farman commit 24abf2901b18bf941b9f21ea2ce5791f61097ae4 upstream. We have two nested loops to check the entries within the pfn_array_table arrays. But we mistakenly use the outer array as an index in our check, and completely ignore the indexing performed by the inner loop. Cc: stable@vger.kernel.org Signed-off-by: Eric Farman Message-Id: <20181002010235.42483-1-farman@linux.ibm.com> Signed-off-by: Cornelia Huck Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/vfio_ccw_cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/s390/cio/vfio_ccw_cp.c +++ b/drivers/s390/cio/vfio_ccw_cp.c @@ -172,7 +172,7 @@ static bool pfn_array_table_iova_pinned( for (i = 0; i < pat->pat_nr; i++, pa++) for (j = 0; j < pa->pa_nr; j++) - if (pa->pa_iova_pfn[i] == iova_pfn) + if (pa->pa_iova_pfn[j] == iova_pfn) return true; return false;