__wp_page_copy_user() sometimes needs to read a page directly via a user mapping; to perform the uaccess we therefore need to create a valid user pointer from the address of the page.
uaddr_to_user_ptr_safe() should no longer be used for that purpose. Instead, we use make_user_ptr_for_read_uaccess() to create a user pointer with appropriate bounds and permissions (in PCuABI).
Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memory.c b/mm/memory.c index 3e4490f4ab6e..1380d0d0a7eb 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2870,7 +2870,7 @@ static inline bool __wp_page_copy_user(struct page *dst, struct page *src, * fails, we just zero-fill it. Live with it. */ kaddr = kmap_atomic(dst); - uaddr = uaddr_to_user_ptr_safe(addr & PAGE_MASK); + uaddr = make_user_ptr_for_read_uaccess(addr & PAGE_MASK, PAGE_SIZE);
/* * On architectures with software "accessed" bits, we would