lkml.org 
[lkml]   [2022]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 011/530] io_uring/net: dont update msg_name if not provided
    Date
    From: Pavel Begunkov <asml.silence@gmail.com>

    commit 6f10ae8a155446248055c7ddd480ef40139af788 upstream.

    io_sendmsg_copy_hdr() may clear msg->msg_name if the userspace didn't
    provide it, we should retain NULL in this case.

    Cc: stable@vger.kernel.org
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/97d49f61b5ec76d0900df658cfde3aa59ff22121.1664486545.git.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 | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/fs/io_uring.c
    +++ b/fs/io_uring.c
    @@ -4762,7 +4762,8 @@ static int io_setup_async_msg(struct io_
    async_msg = req->async_data;
    req->flags |= REQ_F_NEED_CLEANUP;
    memcpy(async_msg, kmsg, sizeof(*kmsg));
    - async_msg->msg.msg_name = &async_msg->addr;
    + if (async_msg->msg.msg_name)
    + async_msg->msg.msg_name = &async_msg->addr;
    /* if were using fast_iov, set it to the new one */
    if (!async_msg->free_iov)
    async_msg->msg.msg_iter.iov = async_msg->fast_iov;

    \
     
     \ /
      Last update: 2022-10-24 15:39    [W:4.217 / U:0.664 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site