io_uring: ensure symmetry in handling iter types in loop_rw_iter()
authorJens Axboe <axboe@kernel.dk>
Sun, 12 Sep 2021 12:45:07 +0000 (06:45 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:27:54 +0000 (12:27 +0200)
commitce8f81b76d3bef7b9fe6c8f84d029ab898b19469
tree8cfb5275c05b1e40ce99cfb49987fd808662efee
parent88f3d951e2dbdc7927da799792d885c20b8b94d5
io_uring: ensure symmetry in handling iter types in loop_rw_iter()

commit 16c8d2df7ec0eed31b7d3b61cb13206a7fb930cc upstream.

When setting up the next segment, we check what type the iter is and
handle it accordingly. However, when incrementing and processed amount
we do not, and both iter advance and addr/len are adjusted, regardless
of type. Split the increment side just like we do on the setup side.

Fixes: 4017eb91a9e7 ("io_uring: make loop_rw_iter() use original user supplied pointers")
Cc: stable@vger.kernel.org
Reported-by: Valentina Palmiotti <vpalmiotti@gmail.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c