Skip to content
Commit 6f7a644e authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring/register: cache old SQ/CQ head reading for copies



The SQ and CQ ring heads are read twice - once for verifying that it's
within bounds, and once inside the loops copying SQE and CQE entries.
This is technically incorrect, in case the values could get modified
in between verifying them and using them in the copy loop. While this
won't lead to anything truly nefarious, it may cause longer loop times
for the copies than expected.

Read the ring head values once, and use the verified value in the copy
loops.

Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2c5aae12
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment