From: Caleb Sander Mateos <csander@purestorage.com>
To: Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>
Cc: Govindarajulu Varadarajan <govind.varadar@gmail.com>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Caleb Sander Mateos <csander@purestorage.com>
Subject: [PATCH v2 0/3] ublk: fix struct ublksrv_ctrl_cmd accesses
Date: Fri, 30 Jan 2026 10:14:11 -0700 [thread overview]
Message-ID: <20260130171414.1376543-1-csander@purestorage.com> (raw)
struct ublksrv_ctrl_cmd is part of the io_uring_sqe. Since commit
87213b0d847c ("ublk: allow non-blocking ctrl cmds in IO_URING_F_NONBLOCK
issue") allowed some commands to be handled in the non-blocking issue,
the SQE may lie in userspace-mapped memory. Validate that the SQE size
is the expected 128 bytes before dereferencing it. Use READ_ONCE() to
copy the ublksrv_ctrl_cmd from the SQE to a local variable. This avoids
data races if userspace writes to the SQE concurrently.
v2:
- Make a local copy of the struct ublksrv_ctrl_cmd (Ming)
- Add Reviewed-by tag (Ming)
Caleb Sander Mateos (2):
ublk: use READ_ONCE() to read struct ublksrv_ctrl_cmd
ublk: drop ublk_ctrl_start_recovery() header argument
Govindarajulu Varadarajan (1):
ublk: Validate SQE128 flag before accessing the cmd
drivers/block/ublk_drv.c | 65 +++++++++++++++++++++-------------------
1 file changed, 35 insertions(+), 30 deletions(-)
--
2.45.2
next reply other threads:[~2026-01-30 17:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 17:14 Caleb Sander Mateos [this message]
2026-01-30 17:14 ` [PATCH v2 1/3] ublk: Validate SQE128 flag before accessing the cmd Caleb Sander Mateos
2026-01-30 17:14 ` [PATCH v2 2/3] ublk: use READ_ONCE() to read struct ublksrv_ctrl_cmd Caleb Sander Mateos
2026-01-31 2:08 ` Ming Lei
2026-02-02 15:38 ` Caleb Sander Mateos
2026-01-30 17:14 ` [PATCH v2 3/3] ublk: drop ublk_ctrl_start_recovery() header argument Caleb Sander Mateos
2026-01-31 2:09 ` Ming Lei
2026-01-31 13:49 ` [PATCH v2 0/3] ublk: fix struct ublksrv_ctrl_cmd accesses Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260130171414.1376543-1-csander@purestorage.com \
--to=csander@purestorage.com \
--cc=axboe@kernel.dk \
--cc=govind.varadar@gmail.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox