linux/io_uring
Jens Axboe 73363c262d io_uring: use fget/fput consistently
Normally within a syscall it's fine to use fdget/fdput for grabbing a
file from the file table, and it's fine within io_uring as well. We do
that via io_uring_enter(2), io_uring_register(2), and then also for
cancel which is invoked from the latter. io_uring cannot close its own
file descriptors as that is explicitly rejected, and for the cancel
side of things, the file itself is just used as a lookup cookie.

However, it is more prudent to ensure that full references are always
grabbed. For anything threaded, either explicitly in the application
itself or through use of the io-wq worker threads, this is what happens
anyway. Generalize it and use fget/fput throughout.

Also see the below link for more details.

Link: https://lore.kernel.org/io-uring/CAG48ez1htVSO3TqmrF8QcX2WFuYTRM-VZ_N10i-VZgbtg=NNqw@mail.gmail.com/
Suggested-by: Jann Horn <jannh@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-11-28 11:56:29 -07:00
..
advise.c
advise.h
alloc_cache.h
cancel.c io_uring: use fget/fput consistently 2023-11-28 11:56:29 -07:00
cancel.h
epoll.c
epoll.h
fdinfo.c io_uring/fdinfo: remove need for sqpoll lock for thread/pid retrieval 2023-11-15 06:35:46 -07:00
fdinfo.h
filetable.c
filetable.h
fs.c io_uring/fs: consider link->flags when getting path for LINKAT 2023-11-20 09:01:42 -07:00
fs.h
futex.c
futex.h
io-wq.c
io-wq.h
io_uring.c io_uring: use fget/fput consistently 2023-11-28 11:56:29 -07:00
io_uring.h io_uring: enable io_mem_alloc/free to be used in other parts 2023-11-27 20:53:52 -07:00
kbuf.c io_uring: free io_buffer_list entries via RCU 2023-11-28 11:45:02 -07:00
kbuf.h io_uring: free io_buffer_list entries via RCU 2023-11-28 11:45:02 -07:00
Makefile
msg_ring.c
msg_ring.h
net.c io_uring/net: ensure socket is marked connected on connect retry 2023-11-03 13:25:50 -06:00
net.h
nop.c
nop.h
notif.c
notif.h
opdef.c io_uring/rw: add separate prep handler for fixed read/write 2023-11-06 07:43:16 -07:00
opdef.h
openclose.c
openclose.h
poll.c
poll.h
refs.h
rsrc.c io_uring: fix off-by one bvec index 2023-11-20 15:21:38 -07:00
rsrc.h
rw.c io_uring: do not clamp read length for multishot read 2023-11-06 13:41:58 -07:00
rw.h io_uring/rw: add separate prep handler for fixed read/write 2023-11-06 07:43:16 -07:00
slist.h
splice.c
splice.h
sqpoll.c io_uring/fdinfo: remove need for sqpoll lock for thread/pid retrieval 2023-11-15 06:35:46 -07:00
sqpoll.h
statx.c
statx.h
sync.c
sync.h
tctx.c
tctx.h
timeout.c
timeout.h
uring_cmd.c
uring_cmd.h
waitid.c
waitid.h
xattr.c
xattr.h