]> www.infradead.org Git - users/jedix/linux-maple.git/commit
io_uring/register: cache old SQ/CQ head reading for copies
authorJens Axboe <axboe@kernel.dk>
Wed, 15 Jan 2025 15:39:15 +0000 (08:39 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 15 Jan 2025 15:39:15 +0000 (08:39 -0700)
commit6f7a644eb7db10f9993039bab7740f7982d4edf4
tree343e6d3029d5234a3255cee532392f257eb72a26
parent2c5aae129f427f83eeba5efbfb4e60a777cd073c
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: Jens Axboe <axboe@kernel.dk>
io_uring/register.c