]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: extend provided buf return to fails
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 17 Mar 2022 02:03:38 +0000 (02:03 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Mar 2022 02:24:28 +0000 (20:24 -0600)
commit2c5ed017f9537f2e648a5eefb8c9219dff60ff5a
tree79ad7c4f3fb3eabfec5e4e562330ac0b4747d0fc
parent2cb4569ce647fcbbbf3cdb0d9e8ae5912c6d9d1f
io_uring: extend provided buf return to fails

It's never a good idea to put provided buffers without notifying the
userspace, it'll lead to userspace leaks, so add io_put_kbuf() in
io_req_complete_failed(). The fail helper is called by all sorts of
requests, but it's still safe to do as io_put_kbuf() will return 0 in
for all requests that don't support and so don't expect provided buffers.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/a4880106fcf199d5810707fe2d17126fcdf18bc4.1647481208.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c