linux/io_uring
Jens Axboe 360941242f io_uring/uring_cmd: don't skip completion for a synchronous multishot cmd
If IORING_URING_CMD_MULTISHOT is set, io_uring_cmd() treats any
non-negative return from ->uring_cmd() as the driver having taken
ownership of the request and returns IOU_ISSUE_SKIP_COMPLETE. But
nothing guarantees that the driver did so, and any handler that just
completes the command inline and returns 0 or a positive result then
leaves the request orphaned, leaking the io_kiocb, the async data,
and the file reference.

The special case isn't needed. ublk returns -EIOCBQUEUED for the
multishot fetch command, which is passed through as-is, and the poll
driven socket timestamp command returns -EAGAIN. Kill it, a multishot
handler that wants to hang on to the request must return -EIOCBQUEUED
or -EAGAIN like any other command.

Fixes: 620a50c927 ("io_uring: uring_cmd: add multishot support")
Cc: stable@vger.kernel.org
Reported-by: syzbot+a4ccdd7ebf452e4d4701@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/6a7a0194.b50370da.49fe0.0056.GAE@google.com/
Link: https://lore.kernel.org/all/20260811115125.1831170-1-vasilisalmpanis@gmail.com/
Signed-off-by: Jens Axboe <axboe@kernel.dk>
History 2026-08-15 17:58:09 -06:00
..
advise.c io_uring: finish IOU_OK -> IOU_COMPLETE transition 2025-05-21 08:41:16 -06:00
advise.h io_uring: split out fadvise/madvise operations 2022-07-24 18:39:11 -06:00
alloc_cache.c io_uring: add alloc_cache.c 2025-01-28 15:10:40 -07:00
alloc_cache.h io_uring/rsrc: use kvfree() for the imu cache 2026-04-21 12:19:01 -06:00
bpf-ops.c io_uring/bpf-ops: restrict ctx access to BPF 2026-06-02 11:20:21 -06:00
bpf-ops.h io_uring/bpf-ops: restrict ctx access to BPF 2026-06-02 11:20:21 -06:00
bpf_filter.c Merge branch 'io_uring-7.0' into for-7.1/io_uring 2026-03-14 08:57:15 -06:00
bpf_filter.h io_uring: allow registration of per-task restrictions 2026-02-06 07:29:19 -07:00
cancel.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
cancel.h io_uring/cancel: de-unionize file and user_data in struct io_cancel_data 2026-02-16 14:16:27 -07:00
cmd_net.c io_uring/cmd_net: split ioctl code out of io_uring_cmd_sock() 2026-03-09 07:21:53 -06:00
epoll.c io_uring/epoll: disallow adding an epoll file to an epoll context 2026-05-15 09:57:41 -06:00
epoll.h io_uring/epoll: add support for IORING_OP_EPOLL_WAIT 2025-02-20 07:59:56 -07:00
eventfd.c io_uring: defer eventfd signaling when queued from a wakeup handler 2026-08-15 16:56:49 -06:00
eventfd.h io_uring: defer eventfd signaling when queued from a wakeup handler 2026-08-15 16:56:49 -06:00
fdinfo.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
fdinfo.h io_uring: move fdinfo helpers to its own file 2022-07-24 18:39:12 -06:00
filetable.c io_uring/filetable: clamp alloc_hint to the configured alloc range 2026-02-11 15:20:44 -07:00
filetable.h io_uring: Trim out unused includes 2026-01-05 17:08:20 -07:00
fs.c non-consuming variants of do_{unlinkat,rmdir}() 2026-01-16 12:51:50 -05:00
fs.h io_uring: split out filesystem related operations 2022-07-24 18:39:11 -06:00
futex.c io_uring: defer eventfd signaling when queued from a wakeup handler 2026-08-15 16:56:49 -06:00
futex.h io_uring/futex: don't mark futex wake requests as inflight 2026-07-30 10:35:26 -06:00
io-wq.c io_uring/io-wq: fix worker accounting when canceling creation callbacks 2026-08-15 17:29:22 -06:00
io-wq.h io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
io_uring.c io_uring: defer eventfd signaling when queued from a wakeup handler 2026-08-15 16:56:49 -06:00
io_uring.h io_uring/uring_cmd: skip io_uring_cmd_issue_blocking() task work 2026-07-30 13:18:29 -06:00
kbuf.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
kbuf.h io_uring/kbuf: support min length left for incremental buffers 2026-04-28 16:08:56 -06:00
Kconfig io_uring/bpf-ops: implement loop_step with BPF struct_ops 2026-03-16 16:15:00 -06:00
loop.c io_uring/bpf-ops: restrict ctx access to BPF 2026-06-02 11:20:21 -06:00
loop.h io_uring/bpf-ops: restrict ctx access to BPF 2026-06-02 11:20:21 -06:00
Makefile io_uring/bpf-ops: implement loop_step with BPF struct_ops 2026-03-16 16:15:00 -06:00
memmap.c io_uring/memmap: account the pages a compound region really uses 2026-08-15 17:55:48 -06:00
memmap.h io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
mock_file.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mpscq.h io_uring: get rid of tw_pending for !DEFER task work 2026-06-16 09:48:00 -06:00
msg_ring.c io_uring: switch struct io_ring_ctx internal bitfields to flags 2026-03-16 15:32:59 -06:00
msg_ring.h io_uring/msg_ring: Drop custom destructor 2024-12-27 10:08:21 -07:00
napi.c io_uring/napi: clear tracked NAPI entries on unregister 2026-05-03 23:21:23 -06:00
napi.h io_uring/napi: clear tracked NAPI entries on unregister 2026-05-03 23:21:23 -06:00
net.c io_uring/net: Drop ddir argument from io_msg_copy_hdr 2026-08-15 17:25:33 -06:00
net.h io_uring/net: allow filtering on IORING_OP_CONNECT 2026-05-14 07:23:01 -06:00
nop.c io_uring/nop: fix file reference leak with IOSQE_FIXED_FILE 2026-06-16 06:20:01 -06:00
nop.h io_uring: move nop into its own file 2022-07-24 18:39:11 -06:00
notif.c io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
notif.h io_uring/notif: implement notification stacking 2024-04-22 19:31:18 -06:00
opdef.c io_uring/futex: don't mark futex wake requests as inflight 2026-07-30 10:35:26 -06:00
opdef.h io_uring: remove iopoll_queue from struct io_issue_def 2026-03-16 16:14:14 -06:00
openclose.c io_uring/openclose: fix io_pipe_fixed() slot tracking for specific slots 2026-02-11 20:31:21 -07:00
openclose.h io_uring/bpf_filter: allow filtering on contents of struct open_how 2026-01-27 11:10:46 -07:00
poll.c io_uring: defer eventfd signaling when queued from a wakeup handler 2026-08-15 16:56:49 -06:00
poll.h io_uring: add wrapper type for io_req_tw_func_t arg 2025-11-03 08:31:26 -07:00
query.c io_uring/zcrx: move RQ head/tail to separate cache lines 2026-08-15 17:29:56 -06:00
query.h io_uring/query: drop unused io_handle_query_entry() ctx arg 2025-11-26 09:37:10 -07:00
refs.h io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
register.c io_uring/register: preserve SQ array entries on resize 2026-06-16 10:06:49 -06:00
register.h io_uring: unify getting ctx from passed in file descriptor 2026-04-08 13:21:35 -06:00
rsrc.c io_uring/rsrc: fix folio size overflow in io_vec_fill_bvec() 2026-08-03 20:05:59 -06:00
rsrc.h io_uring/rsrc: bump struct io_mapped_ubuf length field to size_t 2026-05-14 08:12:23 -06:00
rw.c io_uring/rw: Drop custom iov copy in io_iov_buffer_select_prep 2026-08-15 17:25:33 -06:00
rw.h io_uring: add wrapper type for io_req_tw_func_t arg 2025-11-03 08:31:26 -07:00
slist.h io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
splice.c io_uring: don't include filetable.h in io_uring.h 2025-09-08 13:20:46 -06:00
splice.h io_uring/splice: open code 2nd direct file assignment 2024-10-29 13:43:28 -06:00
sqpoll.c io_uring: annotate remote tasks for kcoverage 2026-06-30 17:32:26 -06:00
sqpoll.h io_uring/sqpoll: switch away from getrusage() for CPU accounting 2025-10-22 10:51:20 -06:00
statx.c allow incomplete imports of filenames 2026-01-13 15:18:07 -05:00
statx.h io_uring: move statx handling to its own file 2022-07-24 18:39:11 -06:00
sync.c io_uring/sync: validate passed in offset 2026-01-21 11:50:59 -07:00
sync.h io_uring: split out fs related sync/fallocate functions 2022-07-24 18:39:11 -06:00
tctx.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
tctx.h io_uring/tctx: have io_uring_alloc_task_context() return tctx 2026-04-08 13:21:30 -06:00
timeout.c io_uring/timeout: splice timed out link in timeout handler 2026-05-20 10:02:58 -06:00
timeout.h io_uring/timeout: migrate reqs from ts64 to ktime 2026-03-09 07:21:54 -06:00
truncate.c fs: pass on FTRUNCATE_* flags to do_truncate 2026-03-23 12:41:57 +01:00
truncate.h io_uring: add support for ftruncate 2024-02-09 09:04:39 -07:00
tw.c io_uring: defer eventfd signaling when queued from a wakeup handler 2026-08-15 16:56:49 -06:00
tw.h io_uring: remove the per-ctx fallback task_work machinery 2026-06-13 06:27:20 -06:00
uring_cmd.c io_uring/uring_cmd: don't skip completion for a synchronous multishot cmd 2026-08-15 17:58:09 -06:00
uring_cmd.h io_uring/cmd: remove struct io_uring_cmd_data 2025-07-18 12:34:56 -06:00
wait.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
wait.h io_uring: switch local task_work to a mpscq 2026-06-13 06:27:06 -06:00
waitid.c io_uring: defer eventfd signaling when queued from a wakeup handler 2026-08-15 16:56:49 -06:00
waitid.h io_uring: move cancelations to be io_uring_task based 2024-11-06 13:55:38 -07:00
xattr.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xattr.h io_uring: move xattr related opcodes to its own file 2022-07-24 18:39:11 -06:00
zcrx.c io_uring/zcrx: add dynamic area provisioning 2026-08-15 17:31:24 -06:00
zcrx.h io_uring/zcrx: keep array of areas 2026-08-15 17:29:57 -06:00