Skip to content
Commit fd2206e4 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring: disallow close of ring itself



A previous commit enabled this functionality, which also enabled O_PATH
to work correctly with io_uring. But we can't safely close the ring
itself, as the file handle isn't reference counted inside
io_uring_enter(). Instead of jumping through hoops to enable ring
closure, add a "soft" ->needs_file option, ->needs_file_no_error. This
enables O_PATH file descriptors to work, but still catches the case of
trying to close the ring itself.

Reported-by: default avatarJann Horn <jannh@google.com>
Fixes: 904fbcb1 ("io_uring: remove 'fd is io_uring' from close path")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 1ee08de1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment