]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix off-by-one in sync cancelation file check
authorJens Axboe <axboe@kernel.dk>
Tue, 23 Aug 2022 13:26:08 +0000 (07:26 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 23 Aug 2022 13:26:08 +0000 (07:26 -0600)
commit34a8c92c55fd6ee8369e559907f8736c64a4adf1
tree12da1cc86a67e9ae113af1f5942a5a72e8765fc5
parentab373da3d230cbc6d6c73a455796e503686fac04
io_uring: fix off-by-one in sync cancelation file check

The passed in index should be validated against the number of registered
files we have, it needs to be smaller than the index value to avoid going
one beyond the end.

Fixes: a1459327b574 ("io_uring: add sync cancelation API through io_uring_register()")
Reported-by: Luo Likang <luolikang@nsfocus.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/cancel.c