diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-16 20:46:20 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-16 20:46:20 +0200 |
| commit | 5f19ca4e014f2bd4088b78f31426f0ba3b8e6a3c (patch) | |
| tree | 7357ef42d49b5ff46e1f9c7d0f873a3606b612f4 /io_uring/io_uring.c | |
| parent | d712d205210c494c29f33dc1d1f2ce4d7448faa9 (diff) | |
| parent | 58720809f52779dc0f08e53e54b014209d13eebb (diff) | |
Merge 6.6-rc6 into char-misc-next
We need the char/misc fixes in here as well, to build on for other
changes.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring/io_uring.c')
| -rw-r--r-- | io_uring/io_uring.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 783ed0fff71b..d839a80a6751 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]); |
