Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: prevent speculating sq_array indexing

The SQ index array consists of user provided indexes, which io_uring
then uses to index the SQ, and so it's susceptible to speculation. For
all other queues io_uring tracks heads and tails in kernel, and they
shouldn't need any special care.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/c6c7a25962924a55869e317e4fdb682dfdc6b279.1730687889.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
48324271 b6f58a3f

+1
+1
io_uring/io_uring.c
··· 2245 2245 READ_ONCE(ctx->rings->sq_dropped) + 1); 2246 2246 return false; 2247 2247 } 2248 + head = array_index_nospec(head, ctx->sq_entries); 2248 2249 } 2249 2250 2250 2251 /*