[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXzS1iOjZAVEcZ8k@fedora>
Date: Fri, 30 Jan 2026 23:48:38 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Caleb Sander Mateos <csander@...estorage.com>
Cc: Jens Axboe <axboe@...nel.dk>,
Govindarajulu Varadarajan <govind.varadar@...il.com>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] ublk: don't write to struct ublksrv_ctrl_cmd
On Thu, Jan 29, 2026 at 03:46:15PM -0700, Caleb Sander Mateos wrote:
> ublk_ctrl_uring_cmd_permission() writes to struct ublksrv_ctrl_cmd's
> addr and len fields, which is racy because ublksrv_ctrl_cmd is part of
> the io_uring_sqe, which may lie in userspace-mapped memory. Store the
> values of addr in len in local variables instead to avoid the race.
>
> Fixes: 87213b0d847c ("ublk: allow non-blocking ctrl cmds in IO_URING_F_NONBLOCK issue")
> Signed-off-by: Caleb Sander Mateos <csander@...estorage.com>
The simpler approach is to define local `header` variable and copy data to
it.
Given it is introduced in v6.19-rc1, backport should be easy, so this patch
looks fine:
Reviewed-by: Ming Lei <ming.lei@...hat.com>
Thanks,
Ming
Powered by blists - more mailing lists