]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix types in provided buffer ring
authorDylan Yudaken <dylany@fb.com>
Mon, 13 Jun 2022 10:11:56 +0000 (03:11 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 13 Jun 2022 11:13:31 +0000 (05:13 -0600)
commitdeecdf37e19e6971c2375981a1b16df72b9c3de0
treecf78b3f306d8af65117425aeeb3f70b550d884f7
parentca35d4b16fc28fad3445c79b35e77b16a5a21041
io_uring: fix types in provided buffer ring

The type of head needs to match that of tail in order for rollover and
comparisons to work correctly.

Without this change the comparison of tail to head might incorrectly allow
io_uring to use a buffer that userspace had not given it.

Fixes: e790404d1245 ("io_uring: add support for ring mapped supplied buffers")
Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220613101157.3687-3-dylany@fb.com
Reviewed-by: Hao Xu <howeyxu@tencent.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c