linux-stable/io_uring
Jens Axboe 8c0b563e9b 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 14:37:52 -08:00
..
Makefile
io-wq.c io_uring: break out of iowq iopoll on teardown 2023-09-19 12:20:23 +02:00
io-wq.h io_uring: break out of iowq iopoll on teardown 2023-09-19 12:20:23 +02:00
io_uring.c io_uring/rw: ensure io->bytes_done is always initialized 2024-01-25 14:37:52 -08:00