• Pavel Begunkov's avatar
    io_uring: fix double prep iovec leak · 5f798bea
    Pavel Begunkov authored
    Requests may be prepared multiple times with ->io allocated (i.e. async
    prepared). Preparation functions don't handle it and forget about
    previously allocated resources. This may happen in case of:
    - spurious defer_check
    - non-head (i.e. async prepared) request executed in sync (via nxt).
    
    Make the handlers check, whether they already allocated resources, which
    is true IFF REQ_F_NEED_CLEANUP is set.
    
    Cc: stable@vger.kernel.org # 5.5
    Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    5f798bea
io_uring.c 168 KB