io_uring: protect fixed file indexing with array_index_nospec()
authorJens Axboe <axboe@kernel.dk>
Sat, 26 Oct 2019 13:22:55 +0000 (07:22 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Oct 2019 18:43:06 +0000 (12:43 -0600)
commitb7620121dc04e44ce654297050f9eaf39d414a34
tree6f6ea0f8c5c240d76678841d96c3df79244b2a5a
parent17f2fe35d080d8f64e86a60cdcd3a97edcbc213b
io_uring: protect fixed file indexing with array_index_nospec()

We index the file tables with a user given value. After we check
it's within our limits, use array_index_nospec() to prevent any
spectre attacks here.

Suggested-by: Jann Horn <jannh@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c