]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix overlapped memcpy in io_req_map_rw()
authorPavel Begunkov <asml.silence@gmail.com>
Sat, 5 Sep 2020 21:45:47 +0000 (00:45 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 1 Oct 2020 02:32:33 +0000 (20:32 -0600)
commitb887cf4c45feabb4983d480505d2acb78556c2c3
treebc639f1ec26c75321dd6136b523f8ed6f4cd0459
parent7d1faf2ec90d42c4e4e5128b472d819c37d4dabb
io_uring: fix overlapped memcpy in io_req_map_rw()

When io_req_map_rw() is called from io_rw_prep_async(), it memcpy()
iorw->iter into itself. Even though it doesn't lead to an error, such a
memcpy()'s aliasing rules violation is considered to be a bad practise.

Inline io_req_map_rw() into io_rw_prep_async(). We don't really need any
remapping there, so it's much simpler than the generic implementation.

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