Skip to content
Snippets Groups Projects
Commit d6211ebb authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring/uring_cmd: unconditionally copy SQEs at prep time


This isn't generally necessary, but conditions have been observed where
SQE data is accessed from the original SQE after prep has been done and
outside of the initial issue. Opcode prep handlers must ensure that any
SQE related data is stable beyond the prep phase, but uring_cmd is a bit
special in how it handles the SQE which makes it susceptible to reading
stale data. If the application has reused the SQE before the original
completes, then that can lead to data corruption.

Down the line we can relax this again once uring_cmd has been sanitized
a bit, and avoid unnecessarily copying the SQE.

Fixes: 5eff57fa ("io_uring/uring_cmd: defer SQE copying until it's needed")
Reported-by: default avatarCaleb Sander Mateos <csander@purestorage.com>
Reviewed-by: default avatarCaleb Sander Mateos <csander@purestorage.com>
Reviewed-by: default avatarLi Zetao <lizetao1@huawei.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2b4fc4cd
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment