io_uring: fix dead-hung for non-iter fixed rw
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 24 Nov 2019 08:58:24 +0000 (11:58 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Nov 2019 02:56:11 +0000 (19:56 -0700)
commit311ae9e159d81a1ec1cf645daf40b39ae5a0bd84
tree08f3dbc913f0459274073109bd6c47d83cdac82b
parentf8e85cf255ad57d65eeb9a9d0e59e3dec55bdd9e
io_uring: fix dead-hung for non-iter fixed rw

Read/write requests to devices without implemented read/write_iter
using fixed buffers can cause general protection fault, which totally
hangs a machine.

io_import_fixed() initialises iov_iter with bvec, but loop_rw_iter()
accesses it as iovec, dereferencing random address.

kmap() page by page in this case

Cc: stable@vger.kernel.org
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c