lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6.0 858/862] io_uring: fix fdinfo sqe offsets calculation
    Date
    From: Pavel Begunkov <asml.silence@gmail.com>

    commit 00927931cb630bbf8edb6d7f4dadb25139fc5e16 upstream.

    Only with the big sqe feature they take 128 bytes per entry, but we
    unconditionally advance by 128B. Fix it by using sq_shift.

    Fixes: 3b8fdd1dc35e3 ("io_uring/fdinfo: fix sqe dumping for IORING_SETUP_SQE128")
    Reported-and-tested-by: syzbot+e5198737e8a2d23d958c@syzkaller.appspotmail.com
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/8b41287cb75d5efb8fcb5cccde845ddbbadd8372.1665449983.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    io_uring/fdinfo.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/io_uring/fdinfo.c
    +++ b/io_uring/fdinfo.c
    @@ -95,7 +95,7 @@ static __cold void __io_uring_show_fdinf
    sq_idx = READ_ONCE(ctx->sq_array[entry & sq_mask]);
    if (sq_idx > sq_mask)
    continue;
    - sqe = &ctx->sq_sqes[sq_idx << 1];
    + sqe = &ctx->sq_sqes[sq_idx << sq_shift];
    seq_printf(m, "%5u: opcode:%s, fd:%d, flags:%x, off:%llu, "
    "addr:0x%llx, rw_flags:0x%x, buf_index:%d "
    "user_data:%llu",

    \
     
     \ /
      Last update: 2022-10-19 11:45    [W:3.934 / U:0.916 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site