Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/zcrx: improve types for size calculation

Make sure io_import_umem() promotes the type to long before calculating
the area size. While the area size is capped at 1GB by
io_validate_user_buf_range() and fits into an "int", it's still too
error prone.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
417d029d daa0b901

+1 -1
+1 -1
io_uring/zcrx.c
··· 193 193 return PTR_ERR(pages); 194 194 195 195 ret = sg_alloc_table_from_pages(&mem->page_sg_table, pages, nr_pages, 196 - 0, nr_pages << PAGE_SHIFT, 196 + 0, (unsigned long)nr_pages << PAGE_SHIFT, 197 197 GFP_KERNEL_ACCOUNT); 198 198 if (ret) { 199 199 unpin_user_pages(pages, nr_pages);