summaryrefslogtreecommitdiff
path: root/include/scsi
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-11-24 21:02:01 -0700
committerJens Axboe <axboe@kernel.dk>2023-11-27 08:28:56 -0700
commit820d070feb668aab5bc9413c285a1dda2a70e076 (patch)
treeaf0a8d1641ea47af76f9ee9404e90c60eff76dd6 /include/scsi
parentd6fef34ee4d102be448146f24caf96d7b4a05401 (diff)
io_uring: don't allow discontig pages for IORING_SETUP_NO_MMAP
io_sqes_map() is used rather than io_mem_alloc(), if the application passes in memory for mapping rather than have the kernel allocate it and then mmap(2) the ranges. This then calls __io_uaddr_map() to perform the page mapping and pinning, which checks if we end up with the same pages, if more than one page is mapped. But this check is incorrect and only checks if the first and last pages are the same, where it really should be checking if the mapped pages are contigous. This allows mapping a single normal page, or a huge page range. Down the line we can add support for remapping pages to be virtually contigous, which is really all that io_uring cares about. Cc: stable@vger.kernel.org Fixes: 03d89a2de25b ("io_uring: support for user allocated memory for rings/sqes") Reported-by: Jann Horn <jannh@google.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/scsi')
0 files changed, 0 insertions, 0 deletions