WSL2-Linux-Kernel/io_uring
Jens Axboe 79ea1c6f06 io_uring/rw: ensure io->bytes_done is always initialized
commit 0a535eddbe0dc1de4386046ab849f08aeb2f8faf 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 14:52:48 -08:00
..
Makefile io_uring: move to separate directory 2022-12-14 11:37:31 +01:00
io-wq.c io_uring: break out of iowq iopoll on teardown 2023-09-19 12:22:54 +02:00
io-wq.h io_uring: break out of iowq iopoll on teardown 2023-09-19 12:22:54 +02:00
io_uring.c io_uring/rw: ensure io->bytes_done is always initialized 2024-01-25 14:52:48 -08:00