lkml.org 
[lkml]   [2018]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.18 120/135] s390/cio: Fix how vfio-ccw checks pinned pages
    Date
    4.18-stable review patch.  If anyone has any objections, please let me know.

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

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

    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 <farman@linux.ibm.com>
    Message-Id: <20181002010235.42483-1-farman@linux.ibm.com>
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    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
    @@ -163,7 +163,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;

    \
     
     \ /
      Last update: 2018-10-16 19:40    [W:4.036 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site