]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: limit size of provided buffer ring
authorDylan Yudaken <dylany@fb.com>
Mon, 13 Jun 2022 10:11:57 +0000 (03:11 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 13 Jun 2022 11:13:33 +0000 (05:13 -0600)
commita1a201e7f3f08b1272ec377cc8113a4847d644ad
tree6ad0bb8421a4d1e287ad7cf8e57113207bbd251a
parent96b26f77ed4018387cecf5bff2945c61f99f233f
io_uring: limit size of provided buffer ring

The type of head and tail do not allow more than 2^15 entries in a
provided buffer ring, so do not allow this.
At 2^16 while each entry can be indexed, there is no way to
disambiguate full vs empty.

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220613101157.3687-4-dylany@fb.com
Reviewed-by: Hao Xu <howeyxu@tencent.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c