linux-stable/io_uring
Jens Axboe d6cc8dd231 io_uring/rw: ensure io->bytes_done is always initialized
commit 0a535eddbe upstream.

If IOSQE_ASYNC is set and we fail importing an iovec for a readv or
writev request, then we leave ->bytes_done uninitialized and hence the
eventual failure CQE posted can potentially have a random res value
rather than the expected -EINVAL.

Setup ->bytes_done before potentially failing, so we have a consistent
value if we fail the request early.

Cc: stable@vger.kernel.org
Reported-by: xingwei lee <xrivendell7@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-25 15:27:41 -08:00
..
advise.c
advise.h
alloc_cache.h
cancel.c
cancel.h
epoll.c
epoll.h
fdinfo.c io_uring/fdinfo: lock SQ thread while retrieving thread cpu/pid 2023-11-02 09:35:29 +01:00
fdinfo.h
filetable.c
filetable.h
fs.c io_uring/fs: consider link->flags when getting path for LINKAT 2023-12-03 07:32:11 +01:00
fs.h
io-wq.c io_uring/sqpoll: fix io-wq affinity when IORING_SETUP_SQPOLL is used 2023-09-19 12:27:54 +02:00
io-wq.h io_uring/sqpoll: fix io-wq affinity when IORING_SETUP_SQPOLL is used 2023-09-19 12:27:54 +02:00
io_uring.c io_uring: fix mutex_unlock with unreferenced ctx 2023-12-13 18:39:18 +01:00
io_uring.h
kbuf.c io_uring/kbuf: Allow the full buffer id space for provided buffers 2023-11-20 11:52:00 +01:00
kbuf.h
Makefile
msg_ring.c io_uring/msg_ring: fix missing lock on overflow for IOPOLL 2023-08-30 16:11:05 +02:00
msg_ring.h io_uring: get rid of double locking 2023-08-30 16:11:04 +02:00
net.c net: Declare MSG_SPLICE_PAGES internal sendmsg() flag 2024-01-10 17:10:27 +01:00
net.h
nop.c
nop.h
notif.c
notif.h
opdef.c io_uring: get rid of double locking 2023-08-30 16:11:04 +02:00
opdef.h
openclose.c io_uring: correct check for O_TMPFILE 2023-08-16 18:27:24 +02:00
openclose.h
poll.c io_uring: always lock in io_apoll_task_func 2023-09-19 12:27:54 +02:00
poll.h
refs.h
rsrc.c io_uring: fix off-by one bvec index 2023-12-03 07:32:13 +01:00
rsrc.h io_uring/af_unix: disable sending io_uring over sockets 2023-12-13 18:39:17 +01:00
rw.c io_uring/rw: ensure io->bytes_done is always initialized 2024-01-25 15:27:41 -08:00
rw.h
slist.h
splice.c
splice.h
sqpoll.c io_uring: Don't set affinity on a dying sqpoll thread 2023-09-19 12:27:54 +02:00
sqpoll.h io_uring/sqpoll: fix io-wq affinity when IORING_SETUP_SQPOLL is used 2023-09-19 12:27:54 +02:00
statx.c
statx.h
sync.c
sync.h
tctx.c
tctx.h
timeout.c io_uring: annotate offset timeout races 2023-08-11 12:08:24 +02:00
timeout.h
uring_cmd.c
uring_cmd.h
xattr.c
xattr.h