s390/cio: Fix how vfio-ccw checks pinned pages
Subsystems (5)
From: Eric Farman <[email protected]>
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.
Message-Id: <[email protected]>
--- drivers/s390/cio/vfio_ccw_cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/cio/vfio_ccw_cp.c +1 -1
@@ -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;
Signature · 1 line
2.14.4
Quoted 20 lines · Cornelia Huck
From: Eric Farman <[email protected]>
We have two nested loops to check the entries within the
pfn_array_tablearrays. But we mistakenly use the outer array as an index in our check, and completely ignore the indexing performed by the inner loop.Signed-off-by Eric Farman <[email protected]>Message-Id: <[email protected]>
Signed-off-by Cornelia Huck <[email protected]>--- drivers/s390/cio/vfio_ccw_cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/s390/cio/vfio_ccw_cp.c +0
-0
drivers/s390/cio/vfio_ccw_cp.c static bool pfn_array_table_iova_pinned(struct pfn_array_table *pat, · line 169
Quoted 8 lines
drivers/s390/cio/vfio_ccw_cp.c +1
-1@@ -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.
Re: [PULL 0/1] vfio-ccw: another bugfix
In reply to a message not in the archiveQuoted 18 lines · On Tue, 2 Oct 2018 17:37:47 +0200 Cornelia Huck <[email protected]> wrote:
[Sorry about that; I don't plan to make this a daily thing...]
The following changes since commit
c458dda3d07c110ce1d007998f67273325ad8662:Merge tag 'vfio-ccw-20181001' of
git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccwinto fixes (2018-10-01 16:07:42 +0200)are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw.gittags/vfio-ccw-20181002for you to fetch changes up to
24abf2901b18bf941b9f21ea2ce5791f61097ae4:s390/cio: Fix how vfio-ccw checks pinned pages (2018-10-02 09:45:05 +0200)
----------------------------------------------------------------
Another fix for vfio-ccw: make sure it accesses the correct entries in thepfn_array_tablearrays when checking pinned pages.
Quoted 8 lines
----------------------------------------------------------------
Eric Farman (1):
s390/cio: Fix how vfio-ccw checks pinned pagesdrivers/s390/cio/vfio_ccw_cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Pulled and push to linux-s390:fixes. I'll wait for a couple of days before I send a please pull to Greg with the fixes.
Thanks.
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.