]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: ensure async punted read/write requests copy iovec
authorJens Axboe <axboe@kernel.dk>
Mon, 2 Dec 2019 18:03:47 +0000 (11:03 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 3 Dec 2019 04:33:25 +0000 (21:33 -0700)
commitb22cd3ef4a9ac431ad24d5fbdd96cec5e289dee6
tree3e53204915d5ec5ea6389294a4086f5e48218d78
parent9d64c61e6353fa9d17e9a3039dd3ad4293993d9e
io_uring: ensure async punted read/write requests copy iovec

Currently we don't copy the iovecs when we punt to async context. This
can be problematic for applications that store the iovec on the stack,
as they often assume that it's safe to let the iovec go out of scope
as soon as IO submission has been called. This isn't always safe, as we
will re-copy the iovec once we're in async context.

Make this 100% safe by copying the iovec just once. With this change,
applications may safely store the iovec on the stack for all cases.

Reported-by: 李通洲 <carter.li@eoitek.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c