public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PULL 1/1] s390/cio: Fix how vfio-ccw checks pinned pages
       [not found] <20181002153748.13503-1-cohuck@redhat.com>
@ 2018-10-02 15:37 ` Cornelia Huck
  2018-10-03 13:14   ` Farhan Ali
  0 siblings, 1 reply; 2+ messages in thread
From: Cornelia Huck @ 2018-10-02 15:37 UTC (permalink / raw)
  To: Martin Schwidefsky, Heiko Carstens
  Cc: Halil Pasic, linux-s390, kvm, Eric Farman, stable, Cornelia Huck

From: Eric Farman <farman@linux.ibm.com>

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 <farman@linux.ibm.com>
Message-Id: <20181002010235.42483-1-farman@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 drivers/s390/cio/vfio_ccw_cp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c
index dbe7c7ac9ac8..fd77e46eb3b2 100644
--- a/drivers/s390/cio/vfio_ccw_cp.c
+++ b/drivers/s390/cio/vfio_ccw_cp.c
@@ -163,7 +163,7 @@ static bool pfn_array_table_iova_pinned(struct pfn_array_table *pat,
 
 	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;
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PULL 1/1] s390/cio: Fix how vfio-ccw checks pinned pages
  2018-10-02 15:37 ` [PULL 1/1] s390/cio: Fix how vfio-ccw checks pinned pages Cornelia Huck
@ 2018-10-03 13:14   ` Farhan Ali
  0 siblings, 0 replies; 2+ messages in thread
From: Farhan Ali @ 2018-10-03 13:14 UTC (permalink / raw)
  To: Cornelia Huck, Martin Schwidefsky, Heiko Carstens
  Cc: Halil Pasic, linux-s390, kvm, Eric Farman, stable, Jason J. Herne



On 10/02/2018 11:37 AM, Cornelia Huck wrote:
> From: Eric Farman <farman@linux.ibm.com>
> 
> 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 <farman@linux.ibm.com>
> Message-Id: <20181002010235.42483-1-farman@linux.ibm.com>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>   drivers/s390/cio/vfio_ccw_cp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c
> index dbe7c7ac9ac8..fd77e46eb3b2 100644
> --- a/drivers/s390/cio/vfio_ccw_cp.c
> +++ b/drivers/s390/cio/vfio_ccw_cp.c
> @@ -163,7 +163,7 @@ static bool pfn_array_table_iova_pinned(struct pfn_array_table *pat,
> 
>   	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;
> 

Me and Jason have been looking at this code recently and we think this 
is the right fix.

Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-03 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20181002153748.13503-1-cohuck@redhat.com>
2018-10-02 15:37 ` [PULL 1/1] s390/cio: Fix how vfio-ccw checks pinned pages Cornelia Huck
2018-10-03 13:14   ` Farhan Ali

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox