lkml.org 
[lkml]   [2020]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 517/717] io_uring: fix 0-iov read buffer select
    Date
    From: Pavel Begunkov <asml.silence@gmail.com>

    commit dd20166236953c8cd14f4c668bf972af32f0c6be upstream.

    Doing vectored buf-select read with 0 iovec passed is meaningless and
    utterly broken, forbid it.

    Cc: <stable@vger.kernel.org> # 5.7+
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/io_uring.c | 4 +---
    1 file changed, 1 insertion(+), 3 deletions(-)

    --- a/fs/io_uring.c
    +++ b/fs/io_uring.c
    @@ -3048,9 +3048,7 @@ static ssize_t io_iov_buffer_select(stru
    iov[0].iov_len = kbuf->len;
    return 0;
    }
    - if (!req->rw.len)
    - return 0;
    - else if (req->rw.len > 1)
    + if (req->rw.len != 1)
    return -EINVAL;

    #ifdef CONFIG_COMPAT

    \
     
     \ /
      Last update: 2020-12-28 15:25    [W:4.051 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site