All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ublk: fix struct ublksrv_ctrl_cmd accesses
@ 2026-01-29 22:46 Caleb Sander Mateos
  2026-01-29 22:46 ` [PATCH 1/4] ublk: Validate SQE128 flag before accessing the cmd Caleb Sander Mateos
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Caleb Sander Mateos @ 2026-01-29 22:46 UTC (permalink / raw)
  To: Ming Lei, Jens Axboe
  Cc: Govindarajulu Varadarajan, linux-block, linux-kernel,
	Caleb Sander Mateos

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. Access the
ublksrv_ctrl_cmd fields with READ_ONCE(), as userspace may write to them
concurrently.

Caleb Sander Mateos (3):
  ublk: don't write to struct ublksrv_ctrl_cmd
  ublk: use READ_ONCE() to read struct ublksrv_ctrl_cmd
  ublk: drop ublk_ctrl_{start,end}_recovery() header argument

Govindarajulu Varadarajan (1):
  ublk: Validate SQE128 flag before accessing the cmd

 drivers/block/ublk_drv.c | 163 +++++++++++++++++++--------------------
 1 file changed, 80 insertions(+), 83 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-01-30 16:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29 22:46 [PATCH 0/4] ublk: fix struct ublksrv_ctrl_cmd accesses Caleb Sander Mateos
2026-01-29 22:46 ` [PATCH 1/4] ublk: Validate SQE128 flag before accessing the cmd Caleb Sander Mateos
2026-01-30  8:03   ` Ming Lei
2026-01-29 22:46 ` [PATCH 2/4] ublk: don't write to struct ublksrv_ctrl_cmd Caleb Sander Mateos
2026-01-30 15:48   ` Ming Lei
2026-01-30 16:05     ` Ming Lei
2026-01-29 22:46 ` [PATCH 3/4] ublk: use READ_ONCE() to read " Caleb Sander Mateos
2026-01-30 15:56   ` Ming Lei
2026-01-29 22:46 ` [PATCH 4/4] ublk: drop ublk_ctrl_{start,end}_recovery() header argument Caleb Sander Mateos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.