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)
commitc6e9fa5c0ab811f4bec36a96337f4b1bb77d142c
treecf78b3f306d8af65117425aeeb3f70b550d884f7
parent97da4a537924d87e2261773f3ac9365abb191fc9
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: c7fb19428d67 ("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