diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2026-02-05 18:04:43 +0000 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-02-10 05:26:12 -0700 |
| commit | 417d029dc412c1028bce3d4685700332c0539a95 (patch) | |
| tree | d575e4e2de5e13f199e7a89718340fb14206143d | |
| parent | daa0b901f8319414cf9f56237f15240b95e4b1b2 (diff) | |
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>
| -rw-r--r-- | io_uring/zcrx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index 3d398283cf34..69567e19b4ca 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -193,7 +193,7 @@ static int io_import_umem(struct io_zcrx_ifq *ifq, return PTR_ERR(pages); ret = sg_alloc_table_from_pages(&mem->page_sg_table, pages, nr_pages, - 0, nr_pages << PAGE_SHIFT, + 0, (unsigned long)nr_pages << PAGE_SHIFT, GFP_KERNEL_ACCOUNT); if (ret) { unpin_user_pages(pages, nr_pages); |
