diff options
author | Jens Axboe <axboe@kernel.dk> | 2023-12-21 18:49:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-26 02:35:45 +0300 |
commit | c239b77ea4d6771e65476e31231b87d0b22fde0c (patch) | |
tree | 8aa2966cc08247ca874c0ea7d5eceaf99e81e0a2 /io_uring/io_uring.c | |
parent | 2c487fbf22303cf6f21e59659bccc0ce0ff0ca41 (diff) | |
download | linux-c239b77ea4d6771e65476e31231b87d0b22fde0c.tar.xz |
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>
Diffstat (limited to 'io_uring/io_uring.c')
0 files changed, 0 insertions, 0 deletions