X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=io_uring%2Fio_uring.c;h=d839a80a6751c15e56ffbcd8277149001643e78c;hb=e4078ebbddf69f5a82f164dc07d50321b7f641cf;hp=783ed0fff71b58a9e72a05965024ffbe4cb900bc;hpb=6b41fb277ed41a73608328431f2e76e68c3bca37;p=platform%2Fkernel%2Flinux-rpi.git diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 783ed0f..d839a80 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2686,7 +2686,7 @@ static void *__io_uaddr_map(struct page ***pages, unsigned short *npages, { struct page **page_array; unsigned int nr_pages; - int ret; + int ret, i; *npages = 0; @@ -2716,6 +2716,20 @@ err: */ if (page_array[0] != page_array[ret - 1]) goto err; + + /* + * Can't support mapping user allocated ring memory on 32-bit archs + * where it could potentially reside in highmem. Just fail those with + * -EINVAL, just like we did on kernels that didn't support this + * feature. + */ + for (i = 0; i < nr_pages; i++) { + if (PageHighMem(page_array[i])) { + ret = -EINVAL; + goto err; + } + } + *pages = page_array; *npages = nr_pages; return page_to_virt(page_array[0]);