Skip to content

Commit 34bb771

Browse files
isilenceaxboe
authored andcommitted
io_uring: nospec index for tags on files update
Don't forget to array_index_nospec() for indexes before updating rsrc tags in __io_sqe_files_update(), just use already safe and precalculated index @i. Fixes: c3bdad0 ("io_uring: add generic rsrc update with tags") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 0f5e4b8 commit 34bb771

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9094,7 +9094,7 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
90949094
err = -EBADF;
90959095
break;
90969096
}
9097-
*io_get_tag_slot(data, up->offset + done) = tag;
9097+
*io_get_tag_slot(data, i) = tag;
90989098
io_fixed_file_set(file_slot, file);
90999099
err = io_sqe_file_register(ctx, file, i);
91009100
if (err) {

0 commit comments

Comments
 (0)