io_uring/memmap: don't use page_address() on a highmem page
Jens Axboe
maintainerPATCH 1/1 io_uring/memmap: don't use page_address() on a highmem page
For older/32-bit systems with highmem, don't assume that the pages in a mapped region are always going to be mapped. If io_region_init_ptr() finds that the pages are coalescable, also check if the first page is a HighMem page or not. If it is, fall through to the usual vmap() mapping rather than attempt to get the unmapped page address.
Fixes c4d0ac1c1567 ("io_uring/memmap: optimise single folio regions")
Reported-by [email protected]
Reported-by [email protected]
Tested-by [email protected]
Signed-off-by Jens Axboe <[email protected]>
---
io_uring/memmap.c +1 -1
@@ -116,7 +116,7 @@ static int io_region_init_ptr(struct io_mapped_region *mr)void *ptr;if (io_check_coalesce_buffer (mr->pages, mr->nr_pages, &ifd)) { -if (ifd.nr_folios ==1 ) { +if (ifd.nr_folios ==1 && !PageHighMem (mr->pages[0 ])) { mr->ptr =page_address (mr->pages[0 ]);return 0 ; }
Signature · 1 line
Jens Axboe