rdma: fix build errors on s390 and MIPS due to bad ZERO_PAGE use [Linux 5.1]

rdma: fix build errors on s390 and MIPS due to bad ZERO_PAGE use [Linux 5.1]

This Linux kernel change "rdma: fix build errors on s390 and MIPS due to bad ZERO_PAGE use" is included in the Linux 5.1 release. This change is authored by Linus Torvalds <torvalds [at] linux-foundation.org> on Mon Apr 29 09:48:53 2019 -0700. The commit for this change in Linux stable tree is 6a5c5d2 (patch).

rdma: fix build errors on s390 and MIPS due to bad ZERO_PAGE use

The parameter to ZERO_PAGE() was wrong, but since all architectures
except for MIPS and s390 ignore it, it wasn't noticed until 0-day
reported the build error.

Fixes: 67f269b37f9b ("RDMA/ucontext: Fix regression with disassociate")
Cc: [email protected]
Cc: Andrea Arcangeli <[email protected]>
Cc: Leon Romanovsky <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/infiniband/core/uverbs_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 7843e89..c489f54 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -895,7 +895,7 @@ static vm_fault_t rdma_umap_fault(struct vm_fault *vmf)

    /* Read only pages can just use the system zero page. */
    if (!(vmf->vma->vm_flags & (VM_WRITE | VM_MAYWRITE))) {
-       vmf->page = ZERO_PAGE(vmf->vm_start);
+       vmf->page = ZERO_PAGE(vmf->address);
        get_page(vmf->page);
        return 0;
    }

Leave a Reply

Your email address will not be published. Required fields are marked *