summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-04-06 14:43:57 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-13 21:59:20 +0300
commit50c981bd77900293c32f91b3d28344554a5f3c0b (patch)
treee2b13a7805fae08e58146ddadc4c9600b2c1080c /fs
parent685f42de443d5bb8a81cc238c6047873f1aebaeb (diff)
downloadlinux-50c981bd77900293c32f91b3d28344554a5f3c0b.tar.xz
io_uring: nospec index for tags on files update
[ Upstream commit 34bb77184123ae401100a4d156584f12fa630e5c ] 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: c3bdad0271834 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5fc3a62eae72..21823d1e91de 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8589,7 +8589,7 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
err = -EBADF;
break;
}
- *io_get_tag_slot(data, up->offset + done) = tag;
+ *io_get_tag_slot(data, i) = tag;
io_fixed_file_set(file_slot, file);
err = io_sqe_file_register(ctx, file, i);
if (err) {